From b34c31507f12266470518a92caefdd5268943df2 Mon Sep 17 00:00:00 2001 From: Quentin De Coninck Date: Mon, 9 Jan 2017 16:10:45 +0100 Subject: [PATCH] msg_client/msg_server: encode bytes before sending them --- src/msg_client.py | 2 +- src/msg_server.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/msg_client.py b/src/msg_client.py index 36dccd1..1d7df34 100644 --- a/src/msg_client.py +++ b/src/msg_client.py @@ -34,7 +34,7 @@ try: time.sleep(5.0) request = string_generator(size=MSG_SIZE, chars=string.digits) start_time = datetime.datetime.now() - sock.sendall(request).encode(ENCODING) + sock.sendall(request.encode(ENCODING)) buffer_data = "" while len(buffer_data) < MSG_SIZE: diff --git a/src/msg_server.py b/src/msg_server.py index d33c254..7f1676f 100644 --- a/src/msg_server.py +++ b/src/msg_server.py @@ -50,7 +50,7 @@ class HandleClientConnectionThread(threading.Thread): time.sleep(5.0) response = string_generator(size=self.msg_size, chars=string.digits) start_time = datetime.datetime.now() - self.connection.sendall(response).encode(ENCODING) + self.connection.sendall(response.encode(ENCODING)) buffer_data = "" elif len(buffer_data) > self.msg_size: