MigDus
MigDus

Reputation: 767

Weird error sending integer list with send_json using sockets with zmq with python

I'm using zmq with python with an scheme REQ-REP in order to transfer data. I'm using right now the method send_json to send the data. But for some weird reason, with some examples it works, with other would not.

When the error occurs, the following error message and exception is shown:

File "socket.pyx", line 723, in zmq.core.socket.Socket.send_json (zmq/core/socket.c:6062) File "socket.pyx", line 504, in zmq.core.socket.Socket.send (zmq/core/socket.c:4307) File "socket.pyx", line 148, in zmq.core.socket._send_copy (zmq/core/socket.c:1752) ZMQError: Operation cannot be accomplished in current state

At first I was thinking it was related with the length of the data sent, but then I've found that in some examples even with big chunks of data it works.

Any clues or things I should look for?

thanks

Upvotes: 1

Views: 737

Answers (1)

zubinmehta
zubinmehta

Reputation: 4533

REQ-REP sockets have a strict send/receive cycle(or vice versa) Mostly, this happens when you try to send a request before receiving a response or something similar.

Upvotes: 1

Related Questions