[erlang-questions] C Node Communication Over Localhost

John Koenig koenigjm@REDACTED
Mon Apr 25 18:01:39 CEST 2011


I have experienced an issue on newer versions of Ubuntu Desktop (10.04 
and later) when trying to send messages from an erlang VM to a C node 
which is using ei.  My procedure is as follows (shadow is the hostname 
of the machine I am currently testing on):

1) Start an erlang VM (thus starting empd in the process):  erl -sname 
test@REDACTED -setcookie dev

2) Start the C node, in this case the C node will bind to 
localhost:30000 with a published name of "cnode" using "dev" as its 
secret cookie:  ./my_cnode -P 30000 -N cnode -S dev

3) Attempt to send a message from erlang to C Node: {any, 
cnode@REDACTED} ! {call, self(), {echo}}.

Step 3 results in the following error:

    Error in process <0.43.0> on node 'test@REDACTED' with exit value:
    {badarg,[{erlang,list_to_existing_atom,["cnode@REDACTED"]},{dist_util,recv_challenge,1},{dist_util,handshake_we_started,1}]}

My /etc/hosts file contains:

    127.0.0.1       localhost
    127.0.1.1       shadow

    # The following lines are desirable for IPv6 capable hosts
    ::1     ip6-localhost ip6-loopback
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters

If I change the 127.0.0.1 entry to "127.0.0.1 localhost shadow" and 
comment out the second line, then communication between the VM and C 
node succeeds.  What is happening here?  Is there a way to achieve 
communication over localhost without having to change /etc/hosts?

Thanks in advance,

John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110425/a6aef9c9/attachment.htm>


More information about the erlang-questions mailing list