Erlang echo server with eLite?
Piotr Daruk
piotr.daruk@REDACTED
Thu Jul 25 12:52:36 CEST 2002
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. 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}]}. So I comment this line (%%%) and as it is expected every thing works correctly. It means the client tries to receive message (see attach) which is the next thing it does. That is why I assume that echosrv ! {ClientPid, N} is wrong order. I wrote before about little differences between progs. run on erlang environment and progs. intended to be compiled and run on Linux.
Best regards.
Piotr Daruk / PPS
BS Technical Support Team
tel +48 22 338 12 13, fax +48 22 338 11 00
komertel +48 39123173
komertel fax +48 39122215
www.panasonic.com.pl
----- Original Message -----
From: Fredrik Linder
To: Piotr Daruk ; erlang-questions@REDACTED
Sent: Thursday, July 25, 2002 11:53 AM
Subject: RE: Erlang echo server with eLite?
Hi Piotr
Perhaps there are others who can help you better than I, but here goes nothing.
Using the !-operator one can communicate between erlang processes on differnet erlang nodes, which can be located on different hosts. So, I guess that's a yes to your question. However, in order to do so must all involved erlang nodes have the same cookie (at the time of the message sending) and must also have networking turned on (see doc for erl: http://www.erlang.se/doc/doc-5.1/erts-5.1/doc/html/erl.html, -name or -sname option to erl).
What kind of error are you having with "Srv ! {self(), Msg}" ? This statement adds the erlang term "{self(), Msg}" to the mailbox of the Srv process, which can be read by having the Srv process execute a receive-statement (which reads one message from the mailbox).
Best Regards
/Fredrik
-----Original Message-----
From: owner-erlang-questions@REDACTED [mailto:owner-erlang-questions@REDACTED]On Behalf Of Piotr Daruk
Sent: den 25 juli 2002 10:29
To: erlang-questions@REDACTED
Subject: Erlang echo server with eLite?
Halo!
Despite the fact I'm working for Panasonic Poland, I'm also a student of Warsaw University of Computer Science Dept. I'm now to write a program using functional language. I have chosen Erlang and decided to write an echo server. Yet, I would like to compile that to executable files either server and client. I'm using Linux Mandreak 8.1 and eLite 2.0 that contains a compiler. The problem is that the error occurs when I'm trying to do "Srv ! {self(), Msg}". I mean it compiles but doesn't work! I have already got know that there is difference when I'm writing for eLite. For example I must do erlang:halt(). insted of halt(). What should I do?
Also, dose "Srv ! {self(), Msg}" messaging work as pipe in Linux? Can I communicate to another process from other terminal on the same machine?
I'm waiting for any help! Thanx!!!!!
Best regards.
Piotr Daruk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20020725/814aaa96/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile
Type: application/octet-stream
Size: 264 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20020725/814aaa96/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: echo.erl
Type: application/octet-stream
Size: 219 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20020725/814aaa96/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: client.erl
Type: application/octet-stream
Size: 460 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20020725/814aaa96/attachment-0002.obj>
More information about the erlang-questions
mailing list