And you would also like to enforce that in pike, even if it breaks quite a few valid uses?
We never did that kind of things before. Actually, we specially added the set_read_callback with friends functions to _allow_ this kind of things.
If we do not allow read-callbacks with blocking sockets, we might as well remove the methods to set them, since they are bound to cause "problems" (like my quite intentional use of blocking sockets with asynchronous notification when data is available, to avoid read threads).
/ Per Hedbor ()
Previous text:
2003-03-19 14:00: Subject: I/O callbacks in blocking mode
That should be read as "five usecs later, there's a high probability that it can still be read without blocking".
The easiest way to get into trouble is if you have some other thread or process that reads the data before you get to it. But I wouldn't want to bet that's the only way to get into trouble.
I'm pretty sure it can hapoen with accept() and write(). Not as sure about read(). But I'd prefer a simple rule "don't use callbacks on blocking sockets" to the hairier rule "don't use write or accept callbacks on blocking sockets, but read callbacks are fine, most of the time on most systems".
/ Niels Möller ()