[zeromq-dev] zeromq-3.2.2 question!!!
Chuck Remes
lists at chuckremes.com
Mon Jan 7 20:46:36 CET 2013
On Jan 7, 2013, at 3:50 AM, zhouhuanhuan111 <zhouhuanhuan111 at 163.com> wrote:
> Hello:
>
> I'am a user of zeromq-3.2.2 , now i hava a quetion to ask ,help you can help me :
>
> I create a push tcp socket on a node to send message , create a pull tcp soket on another node to recv message,if the network is broker , then the pull site will canot recv any message but the push site still send message successfull for a long time .
>
> i want the push site immediately return error when the network is broker,how can i do this? attach is my demo for push site and pull site , please help me ,thank you very much!!!
There is no way for zeromq to immediately return an error. Zeromq is a message queueing library where each socket may have many peers. It allows the network connections to go up and down without always notifying the programmer that the network changed state.
If you need this information, I recommend looking at the documentation for zmq_socket_monitor.
http://api.zeromq.org/3-2:zmq-socket-monitor
Alternately, instead of using PUSH/PULL take a look at chapters 4 and 5 in the guide for patterns using DEALER/ROUTER sockets that might be appropriate. Many of those patterns provide for bidirectional communication so you can add your own heartbeats, timeouts and other mechanisms for detecting network failure.
cr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130107/7739ea9f/attachment.htm>
More information about the zeromq-dev
mailing list