From 3f1940df004cbae4ed6dbd6c3bbd756ba8fa3ec9 Mon Sep 17 00:00:00 2001 From: Fomys Date: Thu, 22 Nov 2018 19:24:25 +0100 Subject: [PATCH] =?UTF-8?q?je=20sais=20pas=20ce=20que=20j'ai=20fais=20en?= =?UTF-8?q?=20plus=20depuis=20la=20derni=C3=A8re=20fois?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/main.py b/server/main.py index 4239b9c..dfcd602 100644 --- a/server/main.py +++ b/server/main.py @@ -77,6 +77,9 @@ main_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) main_socket.bind((HOST, PORT)) +class ServerThread(threading.Thread): + """Main server thread""" + #### Threads #### class ClientThread(threading.Thread): """Main thread, for each client""" @@ -224,7 +227,7 @@ class ClientThread(threading.Thread): if chunk != END_MESSAGE: # Get content part # int.from_bytes(chunk[:2], byteorder='big') == Get content size - content += chunk[2:int.from_bytes(chunk[:2], byteorder='big')+2] + content += chunk[2:int.from_bytes(chunk[:2], byteorder='big') + 2] debug(b"Received from" + bytes(str(self.ip), 'ascii') + b" : " + content) return content