Didn't I add a flag to always do "peek" in the read callback?
I needed it in a system that switched between blocking calls to read and non-blocking read callbacks, and it was possible to get a read callback after the socket was emptied with a previous blocking read. I'm sure there's a discussion about the problem in Infokom.
/ Mirar
Previous text:
2003-03-19 16:32: Subject: I/O callbacks in blocking mode
The check doesn't even provide the intended protection against races completely, as I noted earlier. I think the discussion has shown that that particular attempt to detect the error wasn't a good one, so I've reverted it.
I'll instead be looking into moving the callback code completely to the Stdio.Fd class, so that the race is avoided better. Nothing except Stdio.File should be depending on the Stdio.Fd interface, hopefully.
/ Martin Stjernholm, Roxen IS