On 29 January 2013 09:46, Ian Lepore <i...@freebsd.org> wrote:

> You can't use EOF on a read() to determine client life when the nature
> of the client/server relationship is that clients are allowed to
> shutdown(fd, SHUT_WR) as soon as they connect because they expect to
> receive but never send any data.
>
> On the other hand, Alfred's suggestion of using poll(2) rather than
> select(2) worked perfectly.  Polling with an events mask of zero results
> in it returning POLLHUP in revents if the client has closed the socket.

Just make sure that's portable.. :-)



adrian
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Reply via email to