[PEAK] priority of the exceptionals VS readables and writables

Yaroslav Samchuk yarcat at ank-sia.com
Tue Jul 27 13:55:41 EDT 2004


Our practice shows, that OOB data must be read out from the socket before
any data from the normal queue, or, on some linux kernels, you will get
EINVAL error trying to recv data from the normal socket's queue, if urgent
data is available at that moment. Also it seems, that it doesn't make sense
for MS Win (except Win95), in which order you are receiving data from the
socket (exceptional than readable or vice versa).

Actually, we found nothing usefull in the socket's documentation really
concerning desribed stuff, so these are just our heuristics observations.
The only, partially useful, thing, that `man 7 tcp` says is:
TCP  has  no  real out-of-band data; it has urgent data. In Linux this
means if the other end sends newer out-of-band data the older urgent data
is inserted as normal data into the stream (even  when SO_OOBINLINE is not
set). This differs from BSD based stacks.

So, being guided by our practise, it could be fine to change the
implemtation of the `peak.events.io_events:Selector.monitor` method to fire
exceptionals before readables and writables.

Best wishes,

More information about the PEAK mailing list