msg_client/msg_server: encode bytes before sending them
This commit is contained in:
parent
083b1b9032
commit
b34c31507f
@ -34,7 +34,7 @@ try:
|
|||||||
time.sleep(5.0)
|
time.sleep(5.0)
|
||||||
request = string_generator(size=MSG_SIZE, chars=string.digits)
|
request = string_generator(size=MSG_SIZE, chars=string.digits)
|
||||||
start_time = datetime.datetime.now()
|
start_time = datetime.datetime.now()
|
||||||
sock.sendall(request).encode(ENCODING)
|
sock.sendall(request.encode(ENCODING))
|
||||||
|
|
||||||
buffer_data = ""
|
buffer_data = ""
|
||||||
while len(buffer_data) < MSG_SIZE:
|
while len(buffer_data) < MSG_SIZE:
|
||||||
|
@ -50,7 +50,7 @@ class HandleClientConnectionThread(threading.Thread):
|
|||||||
time.sleep(5.0)
|
time.sleep(5.0)
|
||||||
response = string_generator(size=self.msg_size, chars=string.digits)
|
response = string_generator(size=self.msg_size, chars=string.digits)
|
||||||
start_time = datetime.datetime.now()
|
start_time = datetime.datetime.now()
|
||||||
self.connection.sendall(response).encode(ENCODING)
|
self.connection.sendall(response.encode(ENCODING))
|
||||||
buffer_data = ""
|
buffer_data = ""
|
||||||
|
|
||||||
elif len(buffer_data) > self.msg_size:
|
elif len(buffer_data) > self.msg_size:
|
||||||
|
Loading…
Reference in New Issue
Block a user