diff --git a/src/networking/net_module.py b/src/networking/net_module.py index 0f47452..adb3a62 100644 --- a/src/networking/net_module.py +++ b/src/networking/net_module.py @@ -23,18 +23,11 @@ class Networking: Sends the size of the data before sending the data. """ - sock.send(str(len(data)).encode()) + data_len = str(len(bytes(data, "utf-8"))).encode() + sock.send(data_len) response = sock.recv(1024).decode() sock.send(data.encode()) -def recv_any_size(self, client): - """ - Receives data from the client without knowing the size of the data. - Client must send the size of the data before sending the data. - """ - data_size = client.recv(1024).decode() - data = client.recv(int(data_size)).decode() - return data class Server: """