Re: UDP recvmsg blocks after select(), 2.6 bug?

Chris Friesen
2004-10-07T17:03:29Z

Jean-Sebastien Trottier wrote:
> Just an outsider's view of someone that has been following this thread:
>
> Could select() have 2 different behaviors depending on wether the
> O_NONBLOCK flag is set or not on the socket.
>
> 1. If O_NONBLOCK is set, it can immediately return that the socket is
> ready to be read

> 2. In the case where O_NONBLOCK is not set, select() could wait for all
> the checks to be done before deciding to return or not. In this case the
> meaning would be "there is data ready", NOT "there *might* be data
> ready".

This actually sounds quite interesting.

For applications that are prepared to handle the nonblocking case, you get full
speed. For applications coded to POSIX, you get correctness.

It does mean that select() is now a bit more complicated, but applications
become much easier to write.

Chris