[zeromq-dev] 0MQ keepalive

Meng Zhang jammy.linux at gmail.com
Sat Nov 1 03:50:15 CET 2014


Hi, @there,

Following is the issue we encountered in our production env:

We are using ZeroMQ PUB/SUB pattern, 
but the weird thing is that at the SUB  end, netstat showed the zeromq socket is in ESTABLISHED state, 
while at the PUB end, the LISTEN socket is still there, but the corresponding ESTABLISHED socket disappeared.
Given there is not built-in hearbeat mechanism in ZeroMQ, 
for such situation, what's the best practice to leverage TCP keepalive to dectect this issue?

So...at the SUB end, if I set ZMQ_TCP_KEEPALIVE/ZMQ_TCP_KEEPALIVE_IDLE properly, 
* if I choose to use czmq, how can I assert the socket is dead thru the zstr_recv()?
* if use libzmq directly, how can I do the same thing by zmq_msg_recv()?

Regards,
Meng

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20141101/2d97e84e/attachment.htm>


More information about the zeromq-dev mailing list