OpFlex Framework 1.7.0
opflex::ofcore::PeerStatusListener Class Reference

An interface for a listener that will get status update events for peer connection state. More...

#include <opflex/ofcore/PeerStatusListener.h>

Public Types

enum  PeerStatus {
  DISCONNECTED = 0 , CONNECTING = 1 , CONNECTED = 2 , READY = 3 ,
  CLOSING = 4
}
 The status of a particular peer, which will be sent in the peer status update callback. More...
 
enum  Health { DOWN = 0 , DEGRADED = 1 , HEALTHY = 2 }
 Represents the overall health of the opflex connection pool. More...
 

Public Member Functions

virtual ~PeerStatusListener ()
 Destroy the peer status listener.
 
virtual void peerStatusUpdated (const std::string &peerHostname, int peerPort, PeerStatus peerStatus)
 Called when the connection state changes for a given Opflex peer.
 
virtual void healthUpdated (Health health)
 Called when the overall health of the opflex connection pool changes.
 

Detailed Description

An interface for a listener that will get status update events for peer connection state.

Member Enumeration Documentation

◆ Health

Represents the overall health of the opflex connection pool.

Enumerator
DOWN 

There is no ready Opflex peer connection.

DEGRADED 

At least one opflex peer is in a state other than READY.

HEALTHY 

All opflex peers are connected and ready.

◆ PeerStatus

The status of a particular peer, which will be sent in the peer status update callback.

Enumerator
DISCONNECTED 

The peer is disconnected and not trying to connect.

CONNECTING 

The peer is connecting.

CONNECTED 

The peer is connected but not yet ready.

READY 

The peer is connected and ready.

CLOSING 

The peer connection is closing.

Member Function Documentation

◆ healthUpdated()

virtual void opflex::ofcore::PeerStatusListener::healthUpdated ( Health health)
inlinevirtual

Called when the overall health of the opflex connection pool changes.

Will not be called concurrently.

Parameters
healththe new health value

◆ peerStatusUpdated()

virtual void opflex::ofcore::PeerStatusListener::peerStatusUpdated ( const std::string & peerHostname,
int peerPort,
PeerStatus peerStatus )
inlinevirtual

Called when the connection state changes for a given Opflex peer.

Will not be called concurrently.

Parameters
peerHostnamethe hostname of the peer that was updated
peerPortthe port number of the peer that was updated
peerStatusthe new status of the Opflex peer

The documentation for this class was generated from the following file: