Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem in ConnectionHandler class #12

Open
WangJiexin opened this issue Jul 20, 2018 · 1 comment
Open

Problem in ConnectionHandler class #12

WangJiexin opened this issue Jul 20, 2018 · 1 comment

Comments

@WangJiexin
Copy link

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)
@rpadilla6
Copy link

rpadilla6 commented Oct 10, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants