From: Guido van Rossum Date: Sun, 15 Apr 2001 00:42:13 +0000 (+0000) Subject: Set the SO_REUSEADDR socket option in the server thread -- this seems X-Git-Tag: v2.1c2~21 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f3ee46b82a8dd253b60179f004d9db9b145df2e6;p=thirdparty%2FPython%2Fcpython.git Set the SO_REUSEADDR socket option in the server thread -- this seems needed on some platforms (e.g. Solaris 8) when the test is run twice in quick succession. --- diff --git a/Lib/test/test_asynchat.py b/Lib/test/test_asynchat.py index ccaf90781489..60017e0ab53d 100644 --- a/Lib/test/test_asynchat.py +++ b/Lib/test/test_asynchat.py @@ -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()