select() on UDP does not guarantee recvfrom() won't block

Ryan Melendez rmelendez at wayport.net
Tue Nov 6 21:03:02 CET 2007


I've always thought that if I select on a blocking UDP socket that I can
assume that a read subsequent read will not block.  Apparently that is
not the case.  select on linux can in fact lie, it is only a hint.  They
suggest that O_NONBLOCK should be used with select.

I'm linking the _long_ thread if anyone is interested.


This is not a new development, but it is new to me.  Has this been
discussed on the list?  The reason I am asking is that I've recently
come across a problem where my 1.1 freeradius deamon is blocking on
recvfrom on port 1814.

Do you guys consider it fundamentally wrong to select on blocking UDP
sockets?

Thanks,
Ryan


http://www.gossamer-threads.com/lists/engine?do=post_view_flat;post=479100;page=1;sb=post_latest_reply;so=ASC;mh=25;list=linux




More information about the Freeradius-Devel mailing list