Skip to content

Commit

Permalink
Merge pull request #206 from dls-controls/panda-comms-fix
Browse files Browse the repository at this point in the history
Fix a synchronisation bug in PandA comms
  • Loading branch information
coretl committed Apr 24, 2017
2 parents f5632ee + e46cb81 commit 2380f5a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions malcolm/parts/pandabox/pandaboxcontrol.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ def __init__(self, process, hostname, port):

def send(self, message):
response_queue = self.process.create_queue()
self.response_queues.put(response_queue)
self.q.put(message)
self.q.put((message, response_queue))
return response_queue

def recv(self, response_queue, timeout=1.0):
Expand All @@ -60,11 +59,12 @@ def send_recv(self, message, timeout=1.0):
def send_loop(self):
"""Service self.q, sending requests to server"""
while True:
message = self.q.get()
message, response_queue = self.q.get()
if message is Spawnable.STOP:
break
try:
self.log_debug("Sending %r", message)
self.response_queues.put(response_queue)
self.socket.send(message)
except Exception: # pylint:disable=broad-except
self.log_exception(
Expand Down

0 comments on commit 2380f5a

Please sign in to comment.