[erlang-questions] A possible problem with the canonical listener idiom

John Haugeland <>
Thu Jan 1 20:34:45 CET 2009


> Could you kindly point me to the place in code in that tutorial at trapexit
> where you see the race condition?  The process owning the listening socket
> has it open with {active, false}.  After accepting a client's socket that
> socket *inherits socket options* (including {active, false}) from the
> listener, and transfers ownership of the socket to the newly spawned client
> handling process by calling Module:set_socket/2, which does
> inet:setopts(Socket, [{active, once}]) in the context of the process
> different from the listener.
>
> I don't see a race condition here.
>

I apologize.  I misread.  You are correct.

(Also, I need to quit accidentally sending responses to people, rather than
the list.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20090101/c9a6dc94/attachment.html>


More information about the erlang-questions mailing list