21#ifndef G_REQUEST_CLIENT_H
22#define G_REQUEST_CLIENT_H
49 G_EXCEPTION( ProtocolError ,
tx(
"protocol error") )
52 const GNet::Location & host_and_service ,
unsigned int connection_timeout ,
53 unsigned int response_timeout ,
unsigned int idle_timeout ) ;
58 void request(
const std::string & ) ;
81 bool onReceive(
const char * , std::size_t , std::size_t , std::size_t ,
char )
override ;
82 void onSendComplete()
override ;
83 void onDelete(
const std::string & )
override ;
84 void onSecure(
const std::string & ,
const std::string & ,
const std::string & )
override ;
85 void onConnect()
override ;
96 std::string requestLine(
const std::string & )
const ;
97 std::string result( std::string )
const ;
103 std::string m_request ;
A class for making an outgoing connection to a remote server, with support for socket-level protocols...
A lightweight object containing an ExceptionHandler pointer, optional ExceptionSource pointer and opt...
A class that represents the remote target for out-going client connections.
A timer class template in which the timeout is delivered to the specified method.
A network client class that interacts with a remote server using a stateless line-based request/respo...
bool busy() const
Returns true after request() and before the subsequent event signal.
RequestClient(GNet::EventState, const std::string &key, const std::string &ok, const GNet::Location &host_and_service, unsigned int connection_timeout, unsigned int response_timeout, unsigned int idle_timeout)
Constructor.
void request(const std::string &)
Issues a request.
constexpr const char * tx(const char *p) noexcept
A briefer alternative to G::gettext_noop().