Open
Description
I tried many times, and sometimes the program will stuck and I think this is because self.sock.recv() dose not received message. Any method to solve this problem?
class ConnectionHandler:
def init(self):
signal(SIGPIPE, SIG_DFL)
self.sock = zmq.Context().socket(zmq.REQ)
self.sock.connect("tcp://125.0.0.1:5556")
def __call__(self, data):
self.sock.send_string(json.dumps(data))
recieved = json.loads(str(self.sock.recv(), "utf-8"), encoding='utf-8', strict=False)
recieved = [(row[0]['tgt'], row[0]['pred_score'], row[0]['src']) for row in recieved]
return get_with_answers(recieved)
Metadata
Metadata
Assignees
Labels
No labels