From ad0859f2e7b6f659fe964f786277ea2ad3fdf787 Mon Sep 17 00:00:00 2001 From: TheKysek Date: Wed, 3 Aug 2016 13:06:09 +0200 Subject: [PATCH] Add SO_REUSEADDR to socket options --- src/listener.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/listener.py b/src/listener.py index 9c12c6f..46a0b4d 100644 --- a/src/listener.py +++ b/src/listener.py @@ -14,6 +14,7 @@ class Listener(threading.Thread): self.port = port self.family = family 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)) def run(self):