select() actually IS edge triggered
Posted Mar 16, 2003 8:12 UTC (Sun) by
Ross (subscriber, #4065)
In reply to:
select() actually IS edge triggered by IkeTo
Parent article:
Edge-triggered interfaces are too difficult?
Yep, if you are using select() to do nonblocking operations without setting the socket to nonblocking mode, your code will break. Believe me, I've done it :) It won't happen predictably, but it can happen. Basically treat the output from select() as a hint, and then try the operation until you get EAGAIN (or EWOULDBLOCK or whatever), and be prepared to handle the case where the very first call returns that error.
(
Log in to post comments)