Add ZMTP heartbeats

This commit adds ZMTP connection heartbeats described in
http://rfc.zeromq.org/spec:37/ZMTP.
This commit is contained in:
Jonathan Reams
2015-03-16 21:39:16 -04:00
committed by Jonathan Reams
parent 4b4e00bde0
commit cbb3b176a6
12 changed files with 541 additions and 8 deletions

View File

@@ -127,6 +127,10 @@ namespace zmq
typedef metadata_t::dict_t properties_t;
bool init_properties (properties_t & properties);
int produce_ping_message(msg_t * msg_);
int process_heartbeat_message(msg_t * msg_);
int produce_pong_message(msg_t * msg_);
// Underlying socket.
fd_t s;
@@ -206,6 +210,16 @@ namespace zmq
// True is linger timer is running.
bool has_handshake_timer;
// Heartbeat stuff
enum {
heartbeat_ivl_timer_id = 0x80,
heartbeat_timeout_timer_id = 0x81,
heartbeat_ttl_timer_id = 0x82
};
bool has_ttl_timer;
bool has_timeout_timer;
bool has_heartbeat_timer;
// Socket
zmq::socket_base_t *socket;