[zeromq-dev] expose dead/slow zyre peer to application layer

Johan Philips johan.philips at kuleuven.be
Tue Sep 1 16:39:31 CEST 2015

Dear all

We are using Zyre/Pyre in our application and it would be great if we 
could expose the pings sent between peers to our application layer, 
especially if one of the peers becomes unreachable.

In the current Zyre implementation, in zyre_node.c it is only logged 
with zsys, if in verbose mode. In zyre_node_ping_peerm you have:

if (zclock_time () >= zyre_peer_evasive_at (peer)) {
         //  If peer is being evasive, force a TCP ping.
         //  TODO: do this only once for a peer in this state;
         //  it would be nicer to use a proper state machine
         //  for peer management.
         if (self->verbose)
             zsys_info ("(%s) peer seems dead/slow name=%s endpoint=%s",
                 self->name, zyre_peer_name (peer), zyre_peer_endpoint 
         zre_msg_t *msg = zre_msg_new (ZRE_MSG_PING);
         zyre_peer_send (peer, &msg);

How could we benefit from this peer management to either send an event 
to our application (using zyre.c) or do we need to do the timing ourselves?


More information about the zeromq-dev mailing list