mirror of
https://github.com/zeromq/libzmq.git
synced 2025-11-17 01:16:02 +01:00
problem: ZMQ_HEARTBEAT is not useful without sending an hello message
When using ZMQ_HEARTBEAT one still needs to implement application-level heartbeat in order to know when to send a hello message. For example, with the majordomo protocol, the worker needs to send a READY message when connecting to a broker. If the connection to the broker drops, and the heartbeat recognizes it the worker won't know about it and won't send the READY msg. To solve that, the majordomo worker still has to implement heartbeat. With this new option, whenever the connection drops and reconnects the hello message will be sent, greatly simplify the majordomo protocol, as now READY and HEARTBEAT can be handled by zeromq.
This commit is contained in:
@@ -322,6 +322,18 @@ Option value unit:: milliseconds
|
||||
Default value:: 30000
|
||||
Applicable socket types:: all but ZMQ_STREAM, only for connection-oriented transports
|
||||
|
||||
ZMQ_HELLO_MSG: set an hello message that will be sent when a new peer connect
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
When set, the socket will automatically send an hello message when a new connection is made or accepted.
|
||||
You may set this on DEALER, ROUTER, CLIENT, SERVER and PEER sockets.
|
||||
The combination with ZMQ_HEARTBEAT_IVL is powerful and simplify protocols,
|
||||
as now heartbeat and sending the hello message can be left out of protocols and be handled by zeromq.
|
||||
|
||||
[horizontal]
|
||||
Option value type:: binary data
|
||||
Option value unit:: N/A
|
||||
Default value:: NULL
|
||||
Applicable socket types:: ZMQ_ROUTER, ZMQ_DEALER, ZMQ_CLIENT, ZMQ_SERVER and ZMQ_PEER
|
||||
|
||||
ZMQ_HEARTBEAT_IVL: Set interval between sending ZMTP heartbeats
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Reference in New Issue
Block a user