Skip to content

Commit f3ee46b

Browse files
committed
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.
1 parent 3fee304 commit f3ee46b

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

Lib/test/test_asynchat.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class echo_server(threading.Thread):
1010

1111
def run(self):
1212
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
13+
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
1314
sock.bind((HOST, PORT))
1415
sock.listen(1)
1516
conn, client = sock.accept()

0 commit comments

Comments
 (0)