mirror of
https://github.com/python/cpython.git
synced 2024-11-24 10:24:35 +08:00
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.
This commit is contained in:
parent
3fee30407e
commit
f3ee46b82a
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user