alessandro írta: > thanks > > infact the server_forever() method is only a serve() method inside an > infinite loop. > > many thanks again, > Here is a snipped that show a "software terminateable threading TCP socker server". The "server" object is a SocketServer instance, server_stopped is a threading.Event instance. You should also import the "select" module.
srvfd = server.fileno() while not server_stopped.isSet(): ready = select.select([srvfd], [], [], 1) # Give one second for incoming connection so we can stop the server in seconds if srvfd in ready[0]: server.handle_request() else: pass # log('No incoming connection, retrying') -- http://mail.python.org/mailman/listinfo/python-list