mirror of
https://github.com/zeromq/libzmq.git
synced 2025-11-07 05:58:45 +01:00
problem: router doesn't know when peer disconnected
ZMQ_ROUTER_NOTIFY doesn't have a context and doesn't play nice with protocols. with ZMQ_DISCONNECT_MSG we can set it to a protocol message, like DISCONNECT in majordomo. Router will send it when a peer is disconnected. Another advantage of ZMQ_DISCONNECT_MSG is that it also works on inproc. Together with ZMQ_HEARTBEAT it allows to build very reliable protocols, and much simpler as well.
This commit is contained in:
@@ -56,6 +56,7 @@ zmq::router_t::router_t (class ctx_t *parent_, uint32_t tid_, int sid_) :
|
||||
options.recv_routing_id = true;
|
||||
options.raw_socket = false;
|
||||
options.can_send_hello_msg = true;
|
||||
options.can_recv_disconnect_msg = true;
|
||||
|
||||
_prefetched_id.init ();
|
||||
_prefetched_msg.init ();
|
||||
|
||||
Reference in New Issue
Block a user