threads check socket

NighterNet darkneter at
Fri Jul 31 13:42:29 EDT 2009

On Jul 31, 10:23 am, "Gabriel Genellina" <gagsl-... at>
> En Fri, 31 Jul 2009 13:35:10 -0300, NighterNet <darkne... at>  
> escribió:
> > 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

Thread added into the array. Well this thread when user leave the
server want to make sure it not in used so that I can reuse it some
how or move into another array.

Need to know the thread speed that need for game server timer to
control it. Don't want it too fast or slow for the game server.
fps = 30
	def run(self):
		while True:
			self.gametime += 1
			if self.gametime > 10000000/fps:
				self.gametime = 0;

More information about the Python-list mailing list