Public Member Functions | Protected Member Functions | List of all members
GNet::BufferedServerPeer Class Referenceabstract

A ServerPeer that does line-buffering on input. More...

#include <gbufferedserverpeer.h>

Inheritance diagram for GNet::BufferedServerPeer:
GNet::ServerPeer GNet::EventHandler GNet::Connection GNet::SocketProtocolSink GPop::ServerPeer GSmtp::AdminServerPeer GSmtp::ServerPeer

Public Member Functions

 BufferedServerPeer (Server::PeerInfo, const std::string &eol)
 Constructor. More...
 
virtual ~BufferedServerPeer ()
 Destructor. More...
 
- Public Member Functions inherited from GNet::ServerPeer
 ServerPeer (Server::PeerInfo)
 Constructor. More...
 
bool send (const std::string &data, std::string::size_type offset=0U)
 Sends data down the socket to the peer. More...
 
void doDelete (const std::string &=std::string())
 Does "onDelete(); delete this". More...
 
std::string logId () const
 Returns an identification string for logging purposes. More...
 
virtual std::pair< bool, AddresslocalAddress () const
 Returns the local address. More...
 
virtual std::pair< bool, AddresspeerAddress () const
 Returns the peer address. More...
 
virtual std::string peerCertificate () const
 Returns the peer's TLS certificate. More...
 
virtual void readEvent ()
 Final override from GNet::EventHandler. More...
 
virtual void writeEvent ()
 Final override from GNet::EventHandler. More...
 
virtual void onException (std::exception &)
 Final override from GNet::EventHandler. More...
 
void doDeleteThis (int)
 Does delete this. Should only be used by the GNet::Server class. More...
 
- Public Member Functions inherited from GNet::EventHandler
virtual ~EventHandler ()
 Destructor. More...
 
virtual void exceptionEvent ()
 Called for an exception event. More...
 
- Public Member Functions inherited from GNet::Connection
virtual ~Connection ()
 Destructor. More...
 
- Public Member Functions inherited from GNet::SocketProtocolSink
virtual ~SocketProtocolSink ()
 Destructor. More...
 

Protected Member Functions

virtual bool onReceive (const std::string &)=0
 Called when a complete line is received from the peer. More...
 
virtual void onData (const char *, ServerPeer::size_type)
 Final override from GNet::SocketProtocolSink. More...
 
- Protected Member Functions inherited from GNet::ServerPeer
virtual ~ServerPeer ()
 Destructor. More...
 
virtual void onDelete (const std::string &reason)=0
 Called just before destruction. More...
 
virtual void onSendComplete ()=0
 Called after flow-control has been released and all residual data sent. More...
 
void sslAccept ()
 Waits for the peer to start a secure session. More...
 
StreamSocketsocket ()
 Returns a reference to the client-server connection socket. More...
 
Serverserver ()
 Returns a pointer to the associated server object. More...
 
- Protected Member Functions inherited from GNet::SocketProtocolSink
virtual void onSecure (const std::string &peer_certificate)=0
 Called once the secure socket protocol has been successfully negotiated. More...
 

Additional Inherited Members

- Public Types inherited from GNet::ServerPeer
typedef std::string::size_type size_type
 

Detailed Description

A ServerPeer that does line-buffering on input.

Definition at line 41 of file gbufferedserverpeer.h.

Constructor & Destructor Documentation

GNet::BufferedServerPeer::BufferedServerPeer ( Server::PeerInfo  peer_info,
const std::string &  eol 
)

Constructor.

Definition at line 26 of file gbufferedserverpeer.cpp.

GNet::BufferedServerPeer::~BufferedServerPeer ( )
virtual

Destructor.

Definition at line 32 of file gbufferedserverpeer.cpp.

Member Function Documentation

void GNet::BufferedServerPeer::onData ( const char *  p,
ServerPeer::size_type  n 
)
protectedvirtual
virtual bool GNet::BufferedServerPeer::onReceive ( const std::string &  )
protectedpure virtual

Called when a complete line is received from the peer.

Returns false if no more lines should be delivered.

Implemented in GSmtp::ServerPeer, GSmtp::AdminServerPeer, and GPop::ServerPeer.


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