dnp3 (C++ API) 1.8.0-RC1
Loading...
Searching...
No Matches
dnp3::ClientConnectionHandler Class Referenceabstract

Provides fine-grained control over how TCP and TLS clients connect to endpoints. More...

#include <dnp3.hpp>

Public Member Functions

virtual std::chrono::steady_clock::duration disconnected (const char *addr, const char *hostname)=0
 Notification that a previously successful connection failed. The task will sleep for the specified duration before attempting another connection. More...
 
virtual void connecting (const char *addr, const char *hostname)=0
 Notification that a connection attempt is being made. More...
 
virtual void connect_failed (const char *addr, const char *hostname)=0
 Notification that connection operation failed. More...
 
virtual void connected (const char *addr, const char *hostname)=0
 Notification that a connection attempt succeeded. More...
 
virtual void resolution_failed (const char *hostname)=0
 Notification that DNS resolution failed. More...
 
virtual void next (NextEndpointAction &action)=0
 Called to get the next endpoint to connect to or to sleep for a duration. Use the provided action object to specify the response. More...
 

Detailed Description

Provides fine-grained control over how TCP and TLS clients connect to endpoints.

Note
this class is an "interface" and only has virtual methods, some of which may have default implementations.

Member Function Documentation

◆ connect_failed()

virtual void dnp3::ClientConnectionHandler::connect_failed ( const char *  addr,
const char *  hostname 
)
pure virtual

Notification that connection operation failed.

Parameters
addrSocket address that failed to connect
hostnameOptional hostname (empty string if none)

◆ connected()

virtual void dnp3::ClientConnectionHandler::connected ( const char *  addr,
const char *  hostname 
)
pure virtual

Notification that a connection attempt succeeded.

Parameters
addrSocket address that connected successfully
hostnameOptional hostname (empty string if none)

◆ connecting()

virtual void dnp3::ClientConnectionHandler::connecting ( const char *  addr,
const char *  hostname 
)
pure virtual

Notification that a connection attempt is being made.

Parameters
addrSocket address being connected to
hostnameOptional hostname (empty string if none)

◆ disconnected()

virtual std::chrono::steady_clock::duration dnp3::ClientConnectionHandler::disconnected ( const char *  addr,
const char *  hostname 
)
pure virtual

Notification that a previously successful connection failed. The task will sleep for the specified duration before attempting another connection.

Parameters
addrSocket address that was disconnected
hostnameOptional hostname (empty string if none)
Returns
Amount of time to sleep before attempting to reconnect

◆ next()

virtual void dnp3::ClientConnectionHandler::next ( NextEndpointAction &  action)
pure virtual

Called to get the next endpoint to connect to or to sleep for a duration. Use the provided action object to specify the response.

Parameters
actionAction object to specify next endpoint or sleep duration

◆ resolution_failed()

virtual void dnp3::ClientConnectionHandler::resolution_failed ( const char *  hostname)
pure virtual

Notification that DNS resolution failed.

Parameters
hostnameHostname that failed to resolve

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