SocketAddress destination = req.getDestination();
if (destination == null) {
destination = session.getRemoteAddress();
}
int localWrittenBytes = ch.send(buf.buf(), destination);
writtenBytes += localWrittenBytes;
if (localWrittenBytes == 0 || writtenBytes >= maxWrittenBytes) {
// Kernel buffer is full or wrote too much
key.interestOps(key.interestOps() | SelectionKey.OP_WRITE);