20 #ifndef MPD_FULLY_BUFFERED_SOCKET_HXX
21 #define MPD_FULLY_BUFFERED_SOCKET_HXX
36 size_t normal_size,
size_t peak_size=0)
38 output(normal_size, peak_size) {
49 ssize_t DirectWrite(
const void *data,
size_t length);
62 bool Write(
const void *data,
size_t length);
65 virtual void OnIdle()
override;
A FIFO-like buffer that will allocate more memory on demand to allow large peaks. ...
An event that runs when the EventLoop has become idle, before waiting for more events.
virtual void OnIdle() override
An event loop that polls for events on file/socket descriptors.
FullyBufferedSocket(int _fd, EventLoop &_loop, size_t normal_size, size_t peak_size=0)
std::make_signed< size_t >::type ssize_t
A SocketMonitor specialization that adds an input buffer.
bool Flush()
Send data from the output buffer to the socket.
bool Write(const void *data, size_t length)
A BufferedSocket specialization that adds an output buffer.
virtual bool OnSocketReady(unsigned flags) override