From e7dcec142a361122052702e928b1452110370cd4 Mon Sep 17 00:00:00 2001 From: TheKysek Date: Wed, 3 Aug 2016 19:01:36 +0200 Subject: [PATCH] Move listening socket initialization methods to __init__() --- src/listener.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/listener.py b/src/listener.py index 46a0b4d..31d8045 100644 --- a/src/listener.py +++ b/src/listener.py @@ -16,10 +16,10 @@ class Listener(threading.Thread): 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): self.s.listen(1) self.s.settimeout(1) + + def run(self): while True: try: conn, addr = self.s.accept()