readline() blocks after select() says there's data??

David Bolen db3l at fitlinxx.com
Fri Mar 15 12:34:09 EST 2002


grante at visi.com (Grant Edwards) writes:

> That is true under Win32 -- Just one of the problems when using
> an OS where the networking was pasted on (badly) as an
> afterthought.
> 
> Under Unix, select works on all file descriptors (sockets,
> pipes, serial ports, etc.).  That demonstrates the _right_ way
> to paste on networking as an afterthought.

Of course, to be fair, it's not really networking that was pasted on
badly but rather the socket interface.  If you're using native Win32
operations on native Win32 file handles, you can perform asynchronous
I/O and wait for completion on just about all the native kernel
objects - and even mix in other signaling objects simultaneously.  And
winsock does provide a way to tie socket I/O into the same event
system.

In Unix, select just happens to be a more generic function, whereas in
Windows it was grafted on as part of the socket library.  But that's
more a portability issue than a comment on Windows internals.

--
-- David
-- 
/-----------------------------------------------------------------------\
 \               David Bolen            \   E-mail: db3l at fitlinxx.com  /
  |             FitLinxx, Inc.            \  Phone: (203) 708-5192    |
 /  860 Canal Street, Stamford, CT  06902   \  Fax: (203) 316-5150     \
\-----------------------------------------------------------------------/



More information about the Python-list mailing list