It was added to detect races where some code changes a socket to blocking code while other code (i.e. the callbacks) are still using it in nonblocking mode. Without that check, the result is typically a disastrous hang of the backend thread in that situation.
I can't think of a situation where one want to combine callbacks with blocking mode, because of the obvious risk to get a hanging backend. When and why is that used?
/ Martin Stjernholm, Roxen IS
Previous text:
2003-03-19 12:04: Subject: S: Demonstrera för fredlig lösning
Speaking of compatibility, can you please provide a compelling reason for the
if (!(::mode() & 0x400)) error ("Read callback called on blocking socket!\n");
in __stdio_read_callback()? Otherwise I'm going to remove it as it breaks compatibility.
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)