21 #ifndef G_BUFFERED_SERVER_PEER_H
22 #define G_BUFFERED_SERVER_PEER_H
34 class BufferedServerPeer ;
52 const std::string &
eol()
const ;
62 virtual bool onReceive(
const std::string & ) = 0 ;
66 virtual void onData(
const char * , ServerPeer::size_type ) ;
76 std::string m_expect_data ;
An abstract base class for the GNet::Server's connection to a remote client.
BufferedServerPeer(Server::PeerInfo)
Constructor with an auto-detected line ending.
virtual bool onReceive(const std::string &)=0
Called when a complete line is received from the peer.
virtual void onData(const char *, ServerPeer::size_type)
Override from GNet::SocketProtocolSink.
void expect(size_t n)
Temporarily suspends line buffering so that the next 'n' bytes are accumulated without regard to line...
virtual ~BufferedServerPeer()
Destructor.
A class which does line buffering.
const std::string & eol() const
Returns the line-buffer's line ending.
A ServerPeer that does line-buffering on input.
A structure used in GNet::Server::newPeer().