[erlang-questions] gen_tcp not correctly handling half duplex (shutdown) sockets?

Scott R Parish srp@REDACTED
Tue Dec 18 19:49:05 CET 2007


----- Original Message -----
> Its not clear to me if i'm doing something wrong, or if gen_tcp isn't
> correctly handling half duplex sockets.

...

> Its like erlang is thinking that the whole socket got closed, instead of
> just one direction, and close()ed it.

I think this might be the problem. In R11-B5's inet_drv.c line 8499:

    else if (n == 0) {
        DEBUGF(("  => detected close\r\n"));
        return tcp_recv_closed(desc);
    }

tcp_recv_closed()'s is described as:

   /* The socket has closed, cleanup and send event */

This isn't completely correct as the socket isn't necessarily close()d,
just shutdown() in a single direction.

sRp




More information about the erlang-questions mailing list