From 699e455bef601a04503ea49f6acddd4e6f8aa43a Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Mon, 4 Mar 2024 23:15:39 +0900 Subject: [PATCH] Update server.py --- server.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/server.py b/server.py index f5da5c1..1d0d788 100644 --- a/server.py +++ b/server.py @@ -525,6 +525,22 @@ def send_accept(cls, conn, method, success = True): "success": success }) conn.send(message) + + @classmethod + def readall(cls, conn): + data = b'' + + conn.settimeout(1) + while True: + try: + chunk = conn.recv(buffer_size) + if not chunk: + break + data += chunk + except: + pass + + return data def __init__(self): self.type = ""