Hrvoje Niksic wrote:
Under Linux, select() may report a socket file descriptor as "ready for reading", while nevertheless a subsequent read blocks.
Blarg. Linux is broken, then. This should not happen.
This could for example happen when data has arrived but upon examination has wrong checksum and is discarded.
That's no excuse -- the kernel should check all its checksums *before* waking up selecting processes!
Even if you don't agree that using O_NONBLOCK with select/poll is the best approach to non-blocking, I think there is enough existing practice of doing this to warrant separate consideration of non-blocking sockets (in the OS sense) and select/poll.
I'm not saying there isn't merit in having support for non-blocking file descriptors, only that it's not in any sense a prerequisite or first step towards a select/poll wrapper. They're orthogonal issues, even if you might sometimes want to use them together. -- Greg _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com