how to know if socket is still connected

Laszlo Nagy gandalf at designaproduct.biz
Tue Jul 18 04:08:36 EDT 2006


nephish at xit.net írta:
> ok, yeah, thats in my book.
> thanks, and no, it isn't enabled.
> thanks again for everything
> -sk
>   
Another hint: use select.select() on the socket before reading. It will 
tell you if recv() will block or not. This way you can implement your 
own async timeout and do something else in your program while waiting 
for the connection to be available.

Best,

   Laszlo




More information about the Python-list mailing list