Erlang/OTP Forums

Author Message

<  Erlang  ~  Distributed erlang

wallink
Posted: Sat Dec 22, 2007 7:59 am Reply with quote
Joined: 01 Dec 2007 Posts: 5 Location: Göteborg
Hello, I have a little problem when it comes to communication(erlang) between my windows computer and my mac laptop.

This is what works.

* I can ping using hostnames from and to both computers.

* I have added the longer names that you get when starting erlang with -name flag in /etc/hosts and the hosts-file in windows, so I can ping using the long names as well on both computers( both ways ).

I have no made a very simple client/server app and I start the server on my mac-computer and client on my windows computer. Now I can use the client/server with no problem in both -sname and -name mode.

BUT when I instead start the server on the windows-computer and tries to contact it with the client running on my mac laptop I get the following error:

=ERROR REPORT==== 22-Dec-2007::08:54:14 ===
Error in process <0.44.0> on node 'pelle@wallink.bredbandsbolaget.se' with exit value: {badarg,[{erlang,list_to_existing_atom,["kalle@DATA31.bredbandsbolaget.se"]},
{dist_util,recv_challenge,1},{dist_util,handshake_we_started,1}]}

{badrpc,nodedown}


Anybody have any idea how to fix this?

THANKS!!!
View user's profile Send private message MSN Messenger
bluefly
Posted: Mon Jan 07, 2008 12:19 am Reply with quote
User Joined: 06 Jan 2008 Posts: 10
You are using list_to_existing_atom(). This BIF requires that before it is called, the atom has been previously mentioned. The atom it is looking for, according to your code, is 'kalle@DATA31.bredbandsbolaget.se'

I suppose one might want to use list_to_existing_atom() to make sure not just any arbitrary atom is created. In that case, you probably want to create a list of acceptable clients on your server, including 'kalle@DATA31.bredbandsbolaget.se'. If the atom is not intended to be verified, try list_to_atom() instead.

Disclaimer: Erlang newbie here, so I am always looking for more elegant solutions than what I have discovered so far in the language. Smile
View user's profile Send private message

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum