DynamicByteBuffer dbb = (DynamicByteBuffer) key.attachment();
logger.debug("pending data about to be written");
ByteBuffer toSend = dbb.getByteBuffer();
SocketChannel channel = ((SocketChannel) key.channel());
try {
toSend.flip(); // prepare for write
long bytesWritten = channel.write(toSend);
if (IOLoop.INSTANCE.hasKeepAliveTimeout(channel)) {
prolongKeepAliveTimeout(channel);
}
logger.debug("sent {} bytes to wire", bytesWritten);