Merge pull request #1053 from andkit/fix-1043

Set reuse address option (fixes #1043)
This commit is contained in:
Oskar Hahn 2013-11-14 05:27:36 -08:00
commit 0041b5de57

View File

@ -296,6 +296,7 @@ def get_port(address, port):
""" """
s = socket.socket() s = socket.socket()
try: try:
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind((address, port)) s.bind((address, port))
s.listen(-1) s.listen(-1)
except socket.error: except socket.error: