Add SO_REUSEADDR to socket options
This commit is contained in:
parent
eae426a413
commit
ad0859f2e7
|
@ -14,6 +14,7 @@ class Listener(threading.Thread):
|
||||||
self.port = port
|
self.port = port
|
||||||
self.family = family
|
self.family = family
|
||||||
self.s = socket.socket(self.family, socket.SOCK_STREAM)
|
self.s = socket.socket(self.family, socket.SOCK_STREAM)
|
||||||
|
self.s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
||||||
self.s.bind((self.host, self.port))
|
self.s.bind((self.host, self.port))
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user