question_generation icon indicating copy to clipboard operation
question_generation copied to clipboard

Problem in ConnectionHandler class

Open WangJiexin opened this issue 7 years ago • 1 comments

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)

WangJiexin avatar Jul 20 '18 01:07 WangJiexin

I too have this issue, was able to get the setup to run but it would hang on test output, probably waiting for a return message that is never received. I doubt it's a problem with the class, I know the ports that are showing in docker ps for the corenlp container is just 9000 I'm not sure if that means anything

-- Edit: After some digging that port is supposed to be 9000, I'm using windows subsystem for linux so I'm going to try and see if there's anything firewalled.

rpadilla6 avatar Oct 10 '18 06:10 rpadilla6