end of process

info <>
Thu Nov 18 16:46:44 CET 2010


Hello,
Could you refresh my mind ...
In an gen_server I have this:

init() ->
...
spawn_link(processA),
...

processA()->
...
exit({error,processA_failed})
...

exit will kill the processA: correct ?
who receives the error message ?

In this example (erlang doc) what happens if 

loop(Socket)->
receive
{tcp,Socket,Data}->process(Data),loop(Socket);
{tcp_close,Socket}->ok
end.

ok terminates the loop process: correct ?

Then what is the difference with my first example ? what is better: ok or exit or anything else ?

J-Ph. Constantin
ITS3 Genève
www.its3.ch


More information about the erlang-questions mailing list