21 #ifndef G_NET_BUFFERED_SERVER_PEER__H
22 #define G_NET_BUFFERED_SERVER_PEER__H
33 class BufferedServerPeer ;
58 virtual bool onReceive(
const char * line_data ,
size_t line_size ,
size_t eolsize ) = 0 ;
62 virtual void onData(
const char * , ServerPeer::size_type )
override ;
72 std::string m_expect_data ;
An abstract base class for the GNet::Server's connection to a remote client.
std::string lineBufferEndOfLine() const
Returns the line buffer end-of-line string.
BufferedServerPeer(Server::PeerInfo, LineBufferConfig)
Constructor.
virtual bool onReceive(const char *line_data, size_t line_size, size_t eolsize)=0
Called when a complete line is received from the peer.
A configuration structure for GNet::LineBuffer.
void expect(size_t n)
Temporarily suspends line buffering so that the next 'n' bytes are accumulated without regard to line...
virtual void onData(const char *, ServerPeer::size_type) override
Override from GNet::SocketProtocolSink.
virtual ~BufferedServerPeer()
Destructor.
A class that does line buffering, supporting auto-detection of line endings and fixed-size extraction...
A ServerPeer that does line-buffering on input.
A structure used in GNet::Server::newPeer().