21 #ifndef G_NET_HEAP_CLIENT__H
22 #define G_NET_HEAP_CLIENT__H
57 bool bind_local_address =
false ,
60 unsigned int secure_connection_timeout = 0U ) ;
64 void doDelete(
const std::string & reason ) ;
77 virtual void onDelete(
const std::string & reason ) = 0 ;
80 virtual void onDeleteImp(
const std::string & reason ) ;
89 virtual void onException( std::exception & ) g__final override ;
97 void onConnectionTimeout() ;
98 void onDeletionTimeout() ;
virtual ~HeapClient()
Destructor.
void finish()
Indicates that the last data has been sent and the client is expecting a peer disconnect.
A class for making an outgoing connection to a remote server, with support for socket-level protocols...
virtual void onDeleteImp(const std::string &reason)
An alternative to onDelete() for derived classes in the GNet namespace (in practice GNet::Client)...
HeapClient(const Location &remote_info, bool bind_local_address=false, const Address &local_address=Address::defaultAddress(), bool sync_dns=synchronousDnsDefault(), unsigned int secure_connection_timeout=0U)
Constructor.
The GNet::Address class encapsulates a TCP/UDP transport address.
virtual void onException(std::exception &) g__final override
Override from GNet::ExceptionHandler.
void doDelete(const std::string &reason)
Calls onDelete() and then does a delayed "delete this".
An abstract interface for handling exceptions thrown out of event-loop callbacks (socket events...
A class that holds a host/service name pair and the preferred address family (if any), and also the results of a name-to-address lookup, ie.
virtual void onDelete(const std::string &reason)=0
Called just before deletion.
static Address defaultAddress()
Returns a default address, being the IPv4 wildcard address with a zero port number.
A SimpleClient class for client objects that manage their own lifetime on the heap.
static bool synchronousDnsDefault()
Returns true if DNS queries should normally be synchronous on this platform.
A timer class template in which the timeout is delivered to the specified method. ...
virtual void onConnecting()
Called just before the connection is initiated.