net_kernel(3)

MODULE
net_kernel - Erlang Networking Kernel

DESCRIPTION

The net kernel is a system process which must be running for distributed Erlang to work. The call to erlang:alive/2 will fail if this process is missing. The purpose of this process is to implement parts of the BIFs spawn/4 and spawn_link/4, and to provide authentication and monitoring of the network.

An Erlang system can be started from the UNIX command line as follows:
      % erl -name foobar

With this command line, the net_kernel is started as net_kernel:start([foobar]).

This is done by the system itself, but the start([Name]) function can also be called directly from the normal Erlang shell prompt, and a normal Erlang system is then converted to a node. The kernel can be shut down with the function stop(), but only if the kernel was not started by the system itself. The node is then converted into a normal Erlang system. All other nodes on the network will regard this as a total node crash.

If the system is started as % erl -sname foobar, the node name of the node will be foobar@Host, where Host is the short name of the host (not the fully qualified domain name). The -name flag gives a node with the Fully Qualified Domain Name.

EXPORTS

kernel_apply(M, F, A)

    As the net kernel runs in the 'user space', it is easy to provide another net kernel which is tailor made for a specific application. For example, the user supplied kernel can limit the set of registered processes which can be accessed from remote nodes, or it can spawn a new process for each {nodeup, Node} message and perform some application specific user authentication, a log-in procedure for example. The kernel_apply(M, F, A) function is supplied for this purpose.

monitor_nodes(Flag)

    A process which evaluates this function receives copies of the {nodeup, Node} and {nodedown, Node} messages that the net kernel receives from the runtime system. The flag Flag is set to true to turn the service on, and false to turn it off.

allow(NodeList)

    In a simple way, this function limits access to a node from a specific number of named nodes. A node which evaluates this function can only be accessed from nodes listed in the NodeList variable. Any access attempts made from nodes not listed in NodeList are rejected.

AUTHOR
 Claes Wikstrom -  klacke@erix.ericsson.se