Problem With Distributed Programming Example

Sean Hinde sean.hinde@REDACTED
Wed Jun 8 18:15:32 CEST 2005


Hi,

On 8 Jun 2005, at 16:54, warren_chambliss@REDACTED wrote:

> Hi All,
>
> I'm trying to get up to speed with Erlang and I'm working through  
> the "Getting Started With Erlang" document.  I'm having a problem  
> with the first distributed programming example (tut17).  The  
> message from ping to pong doesn't appear to be getting received (or  
> possibly sent).

Welcome !

>
> A couple questions.
>
> - I can't get the example to work between two machines.  The pong  
> machine has a dash ('-') character in it's hostname.  This causes  
> the Erlang shell to complain with a badarith error in the start_ping 
> () function.  Is there a way to include a dash in a node name?

A node name is syntactically the same as an atom. To include "funny"  
characters in an atom use singe quotes:

'node@REDACTED'

>
> - I can't get the example to work on a single machine using two  
> seperate Erlang shell instances.  I've tried the hostname and  
> "localhost" for nodenames but still no luck.

Check you are starting them with something like:

erl -sname a@REDACTED

erl -sname b@REDACTED

>
> - What's the proper way in the tut17 example to specify nodes in  
> dotted-quad IP notation (xx.xx.xx.xx)?

Good question, I don't know.

>
> - Does message passing automatically work between nodes on machines  
> with different endianness.  For example between nodes on x86 and  
> Sparc?

Yes, all is beautifully transparent

>
> Sorry if these questions are fundamental, but I'm trying to get  
> over the basic learning hump rather quickly.

Great. It sounds like you might be on the track of a new project.  
Plenty of help available on this list if you get stuck.

Sean




More information about the erlang-questions mailing list