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

Chris Friesen
2004-10-21T01:05:09Z

David Schwartz wrote:

> Perhaps I missed the details, but under your proposal, how do you predict
> at 'select' time what mode the socket will be in at 'recvmsg' time?!

Well, if you've got a blocking socket, and do a nonblocking read with
MSG_DONTWAIT, everything works fine. You lose a bit of performance, but it works.

The problem case is if you create a socket, set O_NONBLOCK, do select, clear
O_NONBLOCK, then do a recvmsg().

I suspect it's not a very common thing to do, so my proposal would still help
the vast majority of existing apps.

Chris