[zeromq-dev] Error 156384763: Operation cannot be accomplished in current state

Brilliantov Kirill Vladimirovich brilliantov at byterg.ru
Mon Feb 17 15:25:55 CET 2014

I use zeromq-4.0.3 on own board with ARM CPU (FreeScale iMX538).
My programs use ZMQ_REQ/ZMQ_REP message socket type.

Follow my code for initialize socket:
context = zmq_ctx_new();
socket = zmq_socket(context, ZMQ_REQ);
zmq_setsockopt(socket, ZMQ_RCVTIMEO, &rcv, sizeof(int));
zmq_setsockopt(socket, ZMQ_SNDTIMEO, &snd, sizeof(int));
zmq_connect(socket, address);

If programm not answer on request I use follow code for close socket:

After closing socket I recreate it with code above.
Unfortunally if I send message again I get error 156384763 (Operation
cannot be accomplished in current state).

How should I reopen socket for solve this problem?
Thank you and excuse me for my bad english.

Best regards,
Brilliantov Kirill Vladimirovich

More information about the zeromq-dev mailing list