OpFlex Framework  1.3.0
Peer Status Listener

An object that monitors for updates in that data store for individual connections to the opflex peers and overall status of the connection pool. More...

Modules

 Peer Status Codes
 Defines status codes for peer status updates.
 
 Connection Pool Health Status Codes
 cpeerstatus
 

Typedefs

typedef ofobj_p ofpeerstatuslistener_p
 cpoolhealth More...
 
typedef void(* ofpeerstatus_peer_p )(void *user_data, const char *peerhostname, int port, int status)
 A function pointer to receive peer status updates. More...
 
typedef void(* ofpeerstatus_health_p )(void *user_data, int health)
 A function pointer to recieve connection pool health status updates. More...
 

Functions

ofstatus ofpeerstatuslistener_create (void *user_data, ofpeerstatus_peer_p peer_callback, ofpeerstatus_health_p health_callback, ofpeerstatuslistener_p *obj)
 Creates peer status listener object. More...
 
ofstatus ofpeerstatuslistener_destroy (ofpeerstatuslistener_p *obj)
 Destroy the peer status listener object, and zero the pointer. More...
 

Detailed Description

An object that monitors for updates in that data store for individual connections to the opflex peers and overall status of the connection pool.

There are functions to create, destroy and register the object. During creation, the caller must arrange to pass two C function pointers which the C++ member listener functions of the object will call to send back the update information to the callers C code domain.

Typedef Documentation

typedef void(* ofpeerstatus_health_p)(void *user_data, int health)

A function pointer to recieve connection pool health status updates.

Called when the overall health of the opflex connection pool changes. Will not be called concurrently.

Parameters
user_dataa pointer to an opaque user data structure
healthstatus code for connection pool health.
See Also
Connection Pool Health Status Codes
typedef void(* ofpeerstatus_peer_p)(void *user_data, const char *peerhostname, int port, int status)

A function pointer to receive peer status updates.

Called when the connection state changes for a given Opflex peer. Will not be called concurrently.

Parameters
user_dataa pointer to an opaque user data structure
peerhostnamethe hostname of the peer that was updated
portthe port number of the peer that was updated
statusthe new status of the Opflex peer
See Also
Peer Status Codes

cpoolhealth

A pointer to peer status listener object

Function Documentation

ofstatus ofpeerstatuslistener_create ( void *  user_data,
ofpeerstatus_peer_p  peer_callback,
ofpeerstatus_health_p  health_callback,
ofpeerstatuslistener_p obj 
)

Creates peer status listener object.

You must eventually call ofpeerstatuslistener_destroy on the returned object.

Parameters
objreturn the pointer to created object
user_dataan opaque data blob that will be passed to your handler
peer_callbackcaller provided function pointer for handling status callback of any peer
health_callbackcaller provided functional pointer for handling peer connection pool health callback
Returns
a status code
ofstatus ofpeerstatuslistener_destroy ( ofpeerstatuslistener_p obj)

Destroy the peer status listener object, and zero the pointer.

You must ensure that the listener is no longer being used by any framework objects.

Parameters
objpeer status listener obj
Returns
a status code