From 6aef0660a336b484380b1c8228e47da513cc05cf Mon Sep 17 00:00:00 2001 From: Simon Pirkelmann Date: Fri, 10 Sep 2021 01:22:44 +0200 Subject: [PATCH] empty response queue to avoid desync --- remote_control/measurement_server.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/remote_control/measurement_server.py b/remote_control/measurement_server.py index 8ac9b83..5b7037e 100644 --- a/remote_control/measurement_server.py +++ b/remote_control/measurement_server.py @@ -79,7 +79,8 @@ class MeasurementHandler(socketserver.BaseRequestHandler): time.sleep(0.2) self.request.sendall(b'.\n') pass - reply = self.server.response_queue.get() + while not self.server.response_queue.empty(): + reply = self.server.response_queue.get() # send back response to the original source print(f"sending reply {reply} back to correspondent {self.request}")