52 explicit Client(
const Location & remote_info ,
unsigned int connection_timeout = 0U ,
53 unsigned int response_timeout = 0U ,
unsigned int secure_connection_timeout = 0U ,
54 const std::string & eol = std::string(
"\n") ,
55 bool bind_local_address =
false ,
89 virtual bool onReceive(
const std::string & ) = 0 ;
99 virtual void onDeleteImp(
const std::string & reason )
override ;
105 virtual void onData(
const char * , SimpleClient::size_type )
override ;
116 void operator=(
const Client& ) ;
117 void onConnectionTimeout() ;
118 void onResponseTimeout() ;
125 unsigned int m_connection_timeout ;
126 unsigned int m_response_timeout ;
G::Slot::Signal0 & connectedSignal()
Returns a signal that indicates that the client has successfully connected to the server...
virtual void onConnecting() override
Override from GNet::HeapClient.
virtual void onDeleteImp(const std::string &reason) override
Override from GNet::HeapClient.
virtual void onConnectImp() override
Override from GNet::SimpleClient.
The GNet::Address class encapsulates a TCP/UDP transport address.
G::Slot::Signal2< std::string, std::string > & eventSignal()
Returns a signal that indicates that something interesting has happened.
virtual ~Client()
Destructor.
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.
static Address defaultAddress()
Returns a default address, being the IPv4 wildcard address with a zero port number.
void clearInput()
Clears any pending input from the server.
virtual bool onReceive(const std::string &)=0
Called when a complete line is received from the peer.
A SimpleClient class for client objects that manage their own lifetime on the heap.
G::Slot::Signal1< std::string > & doneSignal()
Returns a signal that indicates that client processing is complete.
A signal class for zero-parameter callbacks.
static bool synchronousDnsDefault()
Returns true if DNS queries should normally be synchronous on this platform.
A class which does line buffering.
Client(const Location &remote_info, unsigned int connection_timeout=0U, unsigned int response_timeout=0U, unsigned int secure_connection_timeout=0U, const std::string &eol=std::string("\n"), bool bind_local_address=false, const Address &local_address=Address::defaultAddress(), bool sync_dns=synchronousDnsDefault())
Constructor.
G::Slot::Signal0 & secureSignal()
Returns a signal that indicates that the security layer has been successfully established.
A timer class template in which the timeout is delivered to the specified method. ...
virtual void onSendImp() override
Override from GNet::SimpleClient.
A HeapClient class that adds slot/signal signalling, connection/response timeouts, and input line buffering.
virtual void onData(const char *, SimpleClient::size_type) override
Override from GNet::SocketProtocolSink.