20 #ifndef MPD_BUFFERED_SOCKET_HXX 21 #define MPD_BUFFERED_SOCKET_HXX 51 ssize_t DirectRead(
void *data,
size_t length);
virtual void OnSocketError(std::exception_ptr ep)=0
The method does not want to get more data for now.
BufferedSocket(int _fd, EventLoop &_loop)
An event loop that polls for events on file/socket descriptors.
std::make_signed< size_t >::type ssize_t
virtual InputResult OnSocketInput(void *data, size_t length)=0
Data has been received on the socket.
ssize_t Write(const void *data, size_t length)
The method was successful, and it is ready to read more data.
void Consume(size_type n)
Marks a chunk as consumed.
Monitor events on a socket.
The method wants to be called again immediately, if there's more data in the buffer.
virtual void OnSocketClosed()=0
A SocketMonitor specialization that adds an input buffer.
The method has closed the socket.
void ConsumeInput(size_t nbytes)
Mark a portion of the input buffer "consumed".
virtual bool OnSocketReady(unsigned flags) override