poll() on a linux box always returns POLLIN
ajb at spkypc.demon.co.uk
Tue Nov 27 15:07:49 CET 2001
Just trying out some asynchronous socket operations in python,
simple client server test code.
Anyway so I get a queue of threads going waiting to be passed sockets.
When they get a socket, I am using poll to implement timeouts. However
poll() always seems to return data ready POLLIN, even when client has
disconnected and finished. when reading the socket, 0 bytes of data is
returned, as you would expect with the peer disconnected ???
any thoughts ???
result = poller.poll(5000)
if result == :
fd,event = result
if event == select.POLLIN:
str = conn.recv(1024)
More information about the Python-list