Select on Win XP

Noah noah at
Sat Mar 20 02:33:24 CET 2004

shifflett at (D. Shifflett) wrote in message news:<da4423a8.0403111444.5d96247f at>...
> Hi all,
> I am trying to run a Python program
> on my Win XP box, that I brought over from a Linux box.
> select() doesn't return until I have sent a packet
> even though I am using a short timeout (1 second)
>         ilist = []
>         ilist.append(my_sock)
>         print "readerthread - my_sock %d" % my_sock.fileno()
>         while not self._stopevent.isSet():
>             print "about to select"
>             il,ol,el = select(ilist,[],[],1)

One thing you might try this for your ilist:
        ilist.append (my_sock.fileno())

In theory it shouldn't matter.
The socket docs say that socket.fileno() is useful for working with select.
It's confusing since docs for say you can pass in a list
of an objects supporting fileno() or you can pass integer filedescriptors, so 
why would socket.fileno() says it's useful for working with 
I don't know, but comeing from a C background using select, I would eliminate
any confusion and just use select with an integer list. 

Let me know if that helps at all.


More information about the Python-list mailing list