This module provides support for communication between distributed Erlang nodes and C nodes, in a manner that is transparent to Erlang processes.
A C node appears to Erlang as a
hidden node.
That is, Erlang processes that know the name of the
C node are able to communicate with it in a normal manner, but
the node name will not appear in the listing provided by the
Erlang function
These functions initialize the
If you use
A C node acting as a server will be assigned a creation number
when it calls
Example 1:
when initializing !");
]]>
Example 2:
when initializing !");
]]>
These functions set up a connection to an Erlang node.
These functions return an open file descriptor on success, or
a negative value indicating that an error occurred --- in
which case they will set
Additionally,
This function closes an open connection to an Erlang node.
On success, 0 is returned. If the call fails, a non-zero value is returned, and the reason for the error can be obtained with the appropriate platform-dependent call.
This function receives a message consisting of a sequence of bytes in the Erlang external format.
If a tick occurs, i.e., the Erlang node on the
other end of the connection has polled this node to see if it
is still alive, the function will return
On success, the message is placed in the specified buffer
and the function returns the number of bytes actually read. On
failure, the function returns a negative value and will set
This function receives the message into the specified buffer,
and decodes into the
The definition of
If
If
If
It is the caller's responsibility to release the
memory pointed to by
If a tick occurs, i.e., the Erlang node on the
other end of the connection has polled this node to see if it
is still alive, the function will return
On success, the function returns
This function is similar to
On success, the function returns
This function sends an Erlang term to a process.
The function returns 1 if successful, otherwise 0 --- in
which case it will set
This function sends an Erlang term to a registered process.
The function returns 1 if successful, otherwise 0 --- in
which case it will set
These functions support calling Erlang functions on remote nodes.
The actual message returned by the rpc server
is a 2-tuple
It is the caller's responsibility to free the returned
These functions are used by a server process to register
with the local name server epmd, thereby allowing
other processes to send messages by using the registered name.
Before calling either of these functions, the process should
have called
To unregister with epmd, simply close the returned
descriptor. See also
On success, the functions return a descriptor connecting the
calling process to epmd. On failure, they return -1 and set
Additionally,
This function is used by a server process to accept a connection from a client process.
On success,
These functions can be used to retrieve information about
the C Node. These values are initially set with
This function can be called by a process to unregister a
specified node name from epmd on the localhost. This may be
useful, for example, when epmd has not detected the failure of a
node, and will not allow the name to be reused. If you use this
function to unregister your own process, be sure to also close
the descriptor that was returned by
Careless use of this function may have unpredictable results, if the registered node is in fact still running.
If the node was successfully unregistered from epmd, the
function returns 0. Otherwise, it returns -1 and sets
These are convenience functions for some common name lookup functions.
If a connection attempt fails, the following can be checked: