[erlang-questions] gen_tcp and processes receiving

Per Hedeland <>
Fri Oct 5 15:50:23 CEST 2007


Bruce Fitzsimons <> wrote:
>
>Back to the original question: where is Stephan's occasional ebadf on 
>gen_tcp:recv coming from? It is not reproducible it with this code 
>(patched or unpatched). Round 2?

I carefully avoided to comment on that.:-) From some quick grep's and
tests, it seems it would have to come from the OS interface down in
inet_drv, i.e. an invalid file descriptor gets passed to recv(2) or
somesuch. E.g. trying to gen_tcp:recv/2 from a closed "Erlang socket"
gives a nice {error, closed}. Maybe some race condition if you manage to
squeeze a gen_tcp call in while the socket is "in the process" of
getting closed? I don't think there is any actual problem in there for
correctly written code though.

--Per



More information about the erlang-questions mailing list