Erlang echo server with eLite?

Luke Gorrie <>
Thu Jul 25 14:26:00 CEST 2002


"Piotr Daruk" <> writes:

> Hi Fredrik!
> 
>     First of all thanx for such quick answer! Please note that I don't
> want to use erlang environment to run my programmes. I want to compile
> them and move to another Linux machine. That is why I'm using "aLike
> 2.0" compiler.  Both programmes can be compiled without any
> problem. Than I start ./echo and ./client.

I'm assuming the client and server run as separate programs (separate
unix processes).

> The client can send only Integers. But when the client tries to send
> a message that is: echosrv ! {ClientPid, N} error occurs:
> {badarg,[{client,main,1}]}.

The expression "echosrv ! {ClientPid, N}" will try to send a message
to the registered process 'echosrv' in the current node (i.e. unix
process). If your echosrv is actually registered in another process,
then it will crash (with 'badarg') because the current node has no
echosrv process.

To send the message to a remote node, you should do:
  "{echosrv, } ! {ClientPid, N}"

Which will use distribution (over a TCP socket) to send the message
to the other process.

I don't know if distribution is easy to use with eLite - Joe?

P.S., the latest version of eLite (aka Stand Alone Erlang) at
http://www.sics.se/~joe/sae.html is 3.1.

Cheers,
Luke




More information about the erlang-questions mailing list