27 const Address & local_interface ,
bool privileged ,
bool sync_dns ,
28 unsigned int secure_connection_timeout ) :
29 SimpleClient(remote_info,local_interface,privileged,sync_dns,secure_connection_timeout) ,
30 m_connect_timer(*this,&
HeapClient::onConnectionTimeout,*this) ,
31 m_delete_timer(*this,&
HeapClient::onDeletionTimeout,*this)
33 m_connect_timer.startTimer( 0U ) ;
40 void GNet::HeapClient::onConnectionTimeout()
46 void GNet::HeapClient::onDeletionTimeout()
52 catch( std::exception & e )
54 G_ERROR(
"HeapClientTimer::onTimeout: exception: " << e.what() ) ;
65 m_connect_timer.cancelTimer() ;
66 m_delete_timer.startTimer( 0U ) ;
67 onDeleteImp( reason , canRetry(reason) ) ;
68 onDelete( reason , canRetry(reason) ) ;
71 void GNet::HeapClient::doDeleteThis()
78 G_WARNING(
"GNet::HeapClient::onException: exception: " << e.what() ) ;
79 doDelete( e.what() ) ;
virtual ~HeapClient()
Destructor.
A class for making an outgoing connection to a remote server, with support for socket-level protocols...
virtual void onException(std::exception &)
Final override from GNet::EventHandler.
The Address class encapsulates an IP transport address.
A class that holds a host/service name pair and optionally the results of a name-to-address lookup...
void doDelete(const std::string &reason)
Calls onDelete() and then does a delayed "delete this".
A SimpleClient class for client objects that manage their own lifetime on the heap.
virtual void onDeleteImp(const std::string &reason, bool can_retry)
An alternative to onDelete() for private implementation classes.
void doDeleteForExit()
A destructor method that may be called at program termination when the normal doDelete() mechanism ha...
HeapClient(const ResolverInfo &remote_info, const Address &local_interface=Address(0U), bool privileged=false, bool sync_dns=synchronousDnsDefault(), unsigned int secure_connection_timeout=0U)
Constructor.
virtual void onConnecting()
Called just before the connection is initiated.