threads check socket

Gabriel Genellina gagsl-py2 at
Fri Jul 31 13:23:02 EDT 2009

En Fri, 31 Jul 2009 13:35:10 -0300, NighterNet <darkneter at>  

> I been trying to find a way to check the socket is open or not. The
> thread are in a group and loop if the sockets are open. If they are
> not open delete the thread and remove the group. I need on this.

What means an "open socket"? Do you want to detect whether the other side  
closed the connection? In that case reading from the socket returns an  
empty string.

Regarding the "threads in a group", I don't understand what you mean. But  
in general, you don't delete a thread, you just return from its run()  
method and the thread finishes execution.

Gabriel Genellina

More information about the Python-list mailing list