-1 on error.drainToEAGAIN
private fn
ptrdiff_t drainToEAGAIN(int fd) @trusted nothrow @nogcDrain a socket file descriptor to EAGAIN by reading and discarding.
Required helper for edge-triggered (EPOLLET) mode: user callbacks that read from a registered socket must continue reading until the syscall returns EAGAIN/EWOULDBLOCK, otherwise the kernel will not signal new readiness for data already buffered. Use this function to enforce the drain contract for protocols like HTTP/1.1 keep-alive where the client may send multiple requests in quick succession.
Parameters
fd | Non-blocking socket file descriptor. |
Returns
Number of bytes drained (discarded), or