[erlang-questions] gen_tcp and processes receiving

Stephan Maka <>
Fri Oct 5 20:15:52 CEST 2007


Per and Bruce, thank you for your answers.

Per Hedeland wrote:
> Fitzsimons <> wrote:
> No it doesn't - but it starts working when self() is evaluated in the
> original process instead of in the spawned one, i.e.
> 
> @@ -12,12 +12,13 @@
>                   "Host: www.erlang.org\r\n"
>                   "Connection: close\r\n"
>                   "\r\n"),
> +    Master = self(),
>      Pid = spawn_link(fun() ->
>                               receive
>                                   go ->
>                                       ok
>                               end,
> -                             receiver(self(), Socket)
> +                             receiver(Master, Socket)
>                       end),
>      ok = gen_tcp:controlling_process(Socket, Pid),
>      Pid ! go,

D'oh, I shouldn't post when I'm in a hurry.

However, I've not been able to reproduce the ebadf fault in this tiny
program.  I will continue research on this. I vaguely suspect SMP
triggering this problem.


Stephan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20071005/03d27db1/attachment.bin>


More information about the erlang-questions mailing list