21 #ifndef G_SMTP_SPAM_CLIENT_H
22 #define G_SMTP_SPAM_CLIENT_H
53 unsigned int connect_timeout ,
unsigned int response_timeout ) ;
56 void request(
const std::string & ) ;
76 virtual bool onReceive(
const std::string & ) ;
82 virtual void onDelete(
const std::string & ,
bool ) ;
85 virtual void onDeleteImp(
const std::string & ,
bool ) ;
88 virtual void onSecure(
const std::string & ) ;
97 std::string headerResult()
const ;
98 bool nextContentLine( std::string & ) ;
99 bool haveCompleteHeader()
const ;
100 std::string headerLine(
const std::string & ,
const std::string & = std::string() )
const ;
101 unsigned long headerBodyLength()
const ;
102 void addHeader(
const std::string & ) ;
103 void addBody(
const std::string & ) ;
104 std::string part(
const std::string & ,
unsigned int ,
const std::string & = std::string() )
const ;
108 typedef std::vector<std::string> StringArray ;
110 std::auto_ptr<std::ifstream> m_in ;
111 unsigned long m_in_size ;
112 unsigned long m_in_lines ;
113 std::auto_ptr<std::ofstream> m_out ;
114 unsigned long m_out_size ;
115 unsigned long m_out_lines ;
117 unsigned int m_header_out_index ;
118 StringArray m_header_out ;
119 StringArray m_header_in ;
bool busy() const
Returns true after request() and before the subsequent event signal.
SMTP and message-store classes.
virtual bool onReceive(const std::string &)
Final override from GNet::Client.
A class that holds a host/service name pair and optionally the results of a name-to-address lookup...
virtual void onDeleteImp(const std::string &, bool)
Final override from GNet::Client.
virtual void onSendComplete()
Final override from GNet::BufferedClient.
void request(const std::string &)
Issues a request.
virtual ~SpamClient()
Destructor.
virtual void onConnect()
Final override from GNet::SimpleClient.
virtual void onDelete(const std::string &, bool)
Final override from GNet::HeapClient.
A client class that interacts with a remote process using a protocol somewhat similar to the spamassa...
virtual void onSecure(const std::string &)
Final override from GNet::SocketProtocol.
#define G_EXCEPTION(class_name, description)
define as a function rather than a type if optimising for size
SpamClient(const GNet::ResolverInfo &host_and_service, unsigned int connect_timeout, unsigned int response_timeout)
Constructor.
A timer class template in which the timeout is delivered to the specified method. ...
A HeapClient class that adds slot/signal signalling, connection/response timeouts, and input line buffering.