mehr kram
This commit is contained in:
parent
70ec94fa76
commit
6a650ef1e8
6 changed files with 89 additions and 96 deletions
|
|
@ -60,14 +60,16 @@ class NetworkThread(threading.Thread):
|
|||
|
||||
def send_msg_and_ack(self, msg):
|
||||
while True:
|
||||
print("m sending")
|
||||
a = convert_to_strings(msg)
|
||||
self.socket.send(str.encode(json.dumps(a)))
|
||||
if (self.socket.poll(5) & zmq.POLLIN) != 0:
|
||||
if (self.socket.poll(50) & zmq.POLLIN) != 0:
|
||||
msg = self.socket.recv()
|
||||
try:
|
||||
if msg:
|
||||
result = json.loads(msg)
|
||||
if result["msg"] == "ack":
|
||||
print("m ack received")
|
||||
return result
|
||||
else:
|
||||
print("got unexpected message {result}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue