GSmtp::SpamClient Class Reference

A client class that interacts with a remote process using a protocol somewhat similar to the spamassassin spamc/spamd protocol. More...

#include <gspamclient.h>

Inheritance diagram for GSmtp::SpamClient:

GNet::Client GNet::HeapClient GNet::SimpleClient GNet::EventHandler GNet::Connection GNet::SocketProtocolSink

List of all members.

Public Member Functions

 SpamClient (const GNet::ResolverInfo &host_and_service, unsigned int connect_timeout, unsigned int response_timeout)
 Constructor.
void request (const std::string &)
 Issues a request.
bool busy () const
 Returns true after request() and before the subsequent event signal.

Protected Member Functions

virtual ~SpamClient ()
 Destructor.
virtual void onConnect ()
 Final override from GNet::SimpleClient.
virtual bool onReceive (const std::string &)
 Final override from GNet::Client.
virtual void onSendComplete ()
 Final override from GNet::BufferedClient.
virtual void onDelete (const std::string &, bool)
 Final override from GNet::HeapClient.
virtual void onDeleteImp (const std::string &, bool)
 Final override from GNet::Client.
virtual void onSecure ()
 Final override from GNet::SocketProtocol.


Detailed Description

A client class that interacts with a remote process using a protocol somewhat similar to the spamassassin spamc/spamd protocol.

Definition at line 47 of file gspamclient.h.


Constructor & Destructor Documentation

GSmtp::SpamClient::SpamClient ( const GNet::ResolverInfo host_and_service,
unsigned int  connect_timeout,
unsigned int  response_timeout 
)

Constructor.

Definition at line 29 of file gspamclient.cpp.

References GNet::ResolverInfo::displayString(), and G_DEBUG.

GSmtp::SpamClient::~SpamClient (  )  [protected, virtual]

Destructor.

Definition at line 43 of file gspamclient.cpp.


Member Function Documentation

void GSmtp::SpamClient::request ( const std::string &  path  ) 

Issues a request.

The base class's "event" signal emitted when processing is complete with a first signal parameter of "spam" and a second parameter giving the parsed response.

Every request will get a single response as long as this method is not called re-entrantly from within the previous request's response signal.

Definition at line 73 of file gspamclient.cpp.

References busy(), G_DEBUG, and G::File::sizeString().

bool GSmtp::SpamClient::busy (  )  const

Returns true after request() and before the subsequent event signal.

Definition at line 47 of file gspamclient.cpp.

Referenced by onConnect(), onDeleteImp(), and request().

void GSmtp::SpamClient::onConnect (  )  [protected, virtual]

Final override from GNet::SimpleClient.

Implements GNet::SimpleClient.

Definition at line 95 of file gspamclient.cpp.

References busy(), and G_DEBUG.

bool GSmtp::SpamClient::onReceive ( const std::string &  line  )  [protected, virtual]

Final override from GNet::Client.

Implements GNet::Client.

Definition at line 176 of file gspamclient.cpp.

References G::Str::printable().

void GSmtp::SpamClient::onSendComplete (  )  [protected, virtual]

Final override from GNet::BufferedClient.

Implements GNet::SimpleClient.

Definition at line 108 of file gspamclient.cpp.

void GSmtp::SpamClient::onDelete ( const std::string &  ,
bool   
) [protected, virtual]

Final override from GNet::HeapClient.

Implements GNet::HeapClient.

Definition at line 52 of file gspamclient.cpp.

void GSmtp::SpamClient::onDeleteImp ( const std::string &  reason,
bool  b 
) [protected, virtual]

Final override from GNet::Client.

Reimplemented from GNet::Client.

Definition at line 56 of file gspamclient.cpp.

References busy(), G::Signal2< P1, P2 >::emit(), GNet::Client::eventSignal(), G_WARNING, and GNet::Client::onDeleteImp().

void GSmtp::SpamClient::onSecure (  )  [protected, virtual]

Final override from GNet::SocketProtocol.

Implements GNet::SocketProtocolSink.

Definition at line 172 of file gspamclient.cpp.


The documentation for this class was generated from the following files:

Generated on Fri Apr 18 15:56:14 2008 for E-MailRelay by  doxygen 1.5.5