Hello, SocketServer.ThreadingTCPServer accepts connections (clients can connect) before and after it's server_forever method is called, see below for an example.
IMHO it should only accept connections while server_forever is running. Kind regards, Okko Example, both _socket.connect calls should throw; import SocketServer import threading import time import socket server = SocketServer.ThreadingTCPServer(("127.0.0.1", 12345), SocketServer.BaseRequestHandler) _socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) _socket.connect(("127.0.0.1", 12345)) def shutdown_server(): while not server._BaseServer__serving: time.sleep(0.1) server.shutdown() thread = threading.Thread(target = shutdown_server) thread.start() server.serve_forever() thread.join() _socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) _socket.connect(("127.0.0.1", 12345)) -- http://mail.python.org/mailman/listinfo/python-list