From 0393e2959883c4339365f71e91bb35750e527df5 Mon Sep 17 00:00:00 2001 From: Alexander Wallar Date: Sat, 6 Feb 2016 19:22:27 -0500 Subject: [PATCH] Server acknowledgement --- launch/server.launch | 4 ++-- src/server/ws.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/launch/server.launch b/launch/server.launch index 7a2db1f..5c81f73 100644 --- a/launch/server.launch +++ b/launch/server.launch @@ -1,8 +1,8 @@ - - + + diff --git a/src/server/ws.py b/src/server/ws.py index 749bce4..640cbb9 100644 --- a/src/server/ws.py +++ b/src/server/ws.py @@ -29,6 +29,8 @@ def onMessage(self, payload, is_binary): frmt = "%ds" % size[0] unpacked = struct.unpack('=I' + frmt, decompressed) msg = json.loads(unpacked[1]) + acknowledge = struct.pack('=b', 0) + common.get_client(msg["from"]).sendMessage(acknowledge, True) latency = Float32() latency.data = received_time - msg["stamp"] self.lat_pubs[msg["from"]].publish(latency)