]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Set the SO_REUSEADDR socket option in the server thread -- this seems
authorGuido van Rossum <guido@python.org>
Sun, 15 Apr 2001 00:42:13 +0000 (00:42 +0000)
committerGuido van Rossum <guido@python.org>
Sun, 15 Apr 2001 00:42:13 +0000 (00:42 +0000)
needed on some platforms (e.g. Solaris 8) when the test is run twice
in quick succession.

Lib/test/test_asynchat.py

index ccaf9078148985d5a5b0c0b5d6b7e043d6705d47..60017e0ab53d9d8c66723870c5ac380c1894b543 100644 (file)
@@ -10,6 +10,7 @@ class echo_server(threading.Thread):
 
     def run(self):
         sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+        sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
         sock.bind((HOST, PORT))
         sock.listen(1)
         conn, client = sock.accept()