[prev in list] [next in list] [prev in thread] [next in thread]
List: freebsd-hackers
Subject: Re: Sockets programming question
From: Adrian Chadd <adrian () freebsd ! org>
Date: 2013-01-29 17:56:42
Message-ID: CAJ-Vmo=rV5+zmPAxyLjuK1H_Yxu-cpQ=93rEONfex7ywrEYHEA () mail ! gmail ! com
[Download RAW message or body]
On 29 January 2013 09:46, Ian Lepore <ian@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-unsubscribe@freebsd.org"
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic