Displaying messages in a remote node IO
Inswitch Solutions - Erlang Evaluation
erlang@REDACTED
Sat Dec 21 17:17:54 CET 2002
Thank you for all your responses.
I have started the code below in Node 1.
I'd like to send a message from Node 2 to Node 1 and display it in Node 1
I don't figure out what should I modify in this code to do this.
%%%%%%%%%%%%%%%%
-module(logger).
-export([start/0, stop/0]).
start() ->
spawn(fun() -> init() end).
stop() ->
logger ! {stop, self()}.
init() ->
register(logger, self()),
process_flag(trap_exit, true),
loop().
loop() ->
receive
{call, Caller, Msg} ->
{self(), sender, Msg},
io:format('Logger closed ~w ~n', Msg)
loop();
{stop, Caller} ->
io:format('Logger closed ~n'),
exit(normal)
end.
%%%%%%%%%%%%
Thanks,
Eduardo Figoli
INSwitch Solutions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20021221/3ab8f521/attachment.htm>
More information about the erlang-questions
mailing list