Commit d0969703 authored by Daniella1's avatar Daniella1
Browse files

added a stopping topic to inform clients before the server shuts down

parent 772bab20
......@@ -109,6 +109,7 @@ def _recording_thread(rtde_con, config_file, filename, frequency, samples, commu
if not keep_running:
signal = communication_queue.get_nowait()
zmq_pub.send_stop()
assert signal == STOP_REQUEST, f"Strange signal received: {signal}."
_thread_log.info("Stop record signal received.")
......
......@@ -9,4 +9,10 @@ class ZMQPublisher():
self.socket.bind("tcp://*:%s" % port)
def publish_on_topic(self, topic, msg_data):
self.socket.send_string(f"{topic} {msg_data}")
\ No newline at end of file
self.socket.send_string(f"{topic} {msg_data}")
def send_stop(self):
print("STOPPING SOCKET")
self.socket.send_string(f"stop stop")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment