Handle EOFError different
This commit is contained in:
parent
20bc52c119
commit
07c6195f02
@ -26,10 +26,13 @@ def update_from_server(queue: Queue):
|
||||
client_socket.connect((SERVER_IP, SERVER_PORT))
|
||||
print_connect()
|
||||
while True:
|
||||
result = receive_image_and_emotions(client_socket)
|
||||
if result is not None:
|
||||
queue.put(result)
|
||||
except Exception: #Normally only if disconnect EOFError
|
||||
try:
|
||||
result = receive_image_and_emotions(client_socket)
|
||||
if result is not None:
|
||||
queue.put(result)
|
||||
except EOFError:
|
||||
pass
|
||||
except Exception:
|
||||
print_disconnect()
|
||||
client_socket.close()
|
||||
time.sleep(1)
|
||||
|
Loading…
Reference in New Issue
Block a user