I would like to preempt corrections to the effect that it is currently
impossible for accept to return both an error code and a socket to read the data
from.  It sounds like there may be a bug in the behavior of accept w.r.t Unix
Domain sockets.  For TCP, if the client sends data, then closes with SO_LINGER
sending a RST, and then the server accepts, it is appropriate to return an error
code and even lose the sent data.  However, if the client simply sends a FIN
(indicating that it will send no more data), then the connection should
definitely accept without error, since the connection is only half-closed, and
the server can send data to the client (in this case of accepting a half-closed
connection, for kevent, a read filter should mark EV_EOF, and a write filter
should not)

> Let's agree: it is okay for accept to return an error code indicating the
> connection has already been terminated, so long as any data sent by the client
> (such that the client had every indication that it was received) is still
> available for the acceptor to read.
>
> -Jon


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-net" in the body of the message

Reply via email to