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

Pieter Hintjens ph at imatix.com
Mon Feb 17 16:27:15 CET 2014


Hi Brilliantov,

- don't use REQ/REP sockets, use DEALER/ROUTER instead

-Pieter

On Mon, Feb 17, 2014 at 3:25 PM, Brilliantov Kirill Vladimirovich
<brilliantov at byterg.ru> wrote:
> Hello!
> 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:
> zmq_close(socket);
> zmq_ctx_destroy(context);
>
> 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
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev



More information about the zeromq-dev mailing list