Download Erlang Interface

Transcript
erl_connect
struct in_addr addr;
addr = inet_addr("150.236.14.75");
if (!erl_connect_xinit("chivas",
"madonna",
"[email protected]",
&addr;
"samplecookiestring..."),
0)
erl_err_quit("<ERROR> when initializing !");
Example 2:
if (!erl_connect_init(17, "samplecookiestring...", 0))
erl_err_quit("<ERROR> when initializing !");
int erl_connect(node)
int erl_xconnect(addr, alive)
Types:
char *node, *alive;
struct in_addr *addr;
These functions set up a connection to an Erlang node.
erl_xconnect() requires the IP address of the remote host and the alive name of the remote node to be specified.
erl_connect() provides an alternative interface, and determines the information from the node name provided.
addr is the 32-bit IP address of the remote host.
alive is the alivename of the remote node.
node is the name of the remote 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 erl_errno to one of:
EHOSTUNREACH
The remote host node is unreachable
ENOMEM
No more memory available.
EIO
I/O error.
Additionally, errno values from socket(2) and connect(2) system calls may be propagated into erl_errno.
#define NODE
"[email protected]"
#define ALIVE "madonna"
#define IP_ADDR "150.236.14.75"
/*** Variant 1 ***/
erl_connect( NODE );
/*** Variant 2 ***/
struct in_addr addr;
addr = inet_addr(IP_ADDR);
40 | Ericsson AB. All Rights Reserved.: Erlang Interface