catch non-blocking socket exceptions

Axel Bock news-and-lists at the-me.de
Thu Jun 26 17:03:11 CEST 2003


Hi all, 

I try to connect to several hosts at once to verify whether a certain
service is running. Now it's quite stupid to connect to one after another,
cause if I do this I'll wait forever if some hosts don't respond (at least
until TCP timeout).

But if I connect to several hosts in parallel and use polling objects I'm
stuck - I don't know how to handle exceptions: are they raised as normal?
If yes, how do I get the correspondig socket object - or file number?
If no, how do I know if a socket timed out, or refused connection, or
something similar? 


Thanks for any hints & greetings, 

		Axel.




More information about the Python-list mailing list