Erlang echo server with eLite?

Piotr Daruk <>
Fri Jul 26 09:13:03 CEST 2002


-Halo!

    I have tried setting cookies erlang:set_cookie(echo_node, nocookie) for
echo server and erlang:set_cookie(client_node, nocookie) for client. After
that I was able to send messages to registered server {echosrv,
} ! {self(), Msg}. It has worked but only under erlang
environment. Yet, when I have compiled my programmes with eLite 2.0 and
started ./echo and ./client I could see an error msg:
{undef, [{auth, set_cookie, 2}]} what is wrong? What should I do to make it
work as I want, not on erlang environment, but just on Linux console?

Cheers,
Piotr
---- Original Message -----
From: "Francesco Cesarini" <>
To: "Piotr Daruk" <>
Cc: <>
Sent: Thursday, July 25, 2002 3:57 PM
Subject: Re: Erlang echo server with eLite?


> You have an example in the FAQ,
> http://www.erlang.org/faq/x778.html#AEN844 The Erlang book (Chapter 10)
> describes it as well.
>
> Francesco
> --
> http://www.erlang-consulting.com
>
> Piotr Daruk wrote:
>
> >Sorry! For such questions, but I'm a freshman to use an Erlang. How
should I
> >set cookies to make this work?
> >
> >Cheers;
> >Piotr
> >
> >----- Original Message -----
> >From: "Francesco Cesarini" <>
> >To: "Piotr Daruk" <>
> >Sent: Thursday, July 25, 2002 3:12 PM
> >Subject: Re: Erlang echo server with eLite?
> >
> >
> >>Don't forget to set the cookies else it will not work.
> >>
> >>Francesco
> >>--
> >>http://www.erlang-consulting.com
> >>
> >>Piotr Daruk wrote:
> >>
> >>>Thanx!!
> >>>Sorry for not being specific!!! Yet, you have assumed correctly! Now I
> >>>understand the Erlang messaging mechanism. I will try that as soon as
> >>>possible.
> >>>
> >>>Best regards.
> >>>Piotr
> >>>----- Original Message -----
> >>>From: "Luke Gorrie" <>
> >>>To: "Piotr Daruk" <>
> >>>Cc: "Fredrik Linder" <>;
> >>><>
> >>>Sent: Thursday, July 25, 2002 2:26 PM
> >>>Subject: Re: Erlang echo server with eLite?
> >>>
> >>>
> >>>>"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