List of usage examples for io.netty.buffer CompositeByteBuf maxNumComponents
int maxNumComponents
To view the source code for io.netty.buffer CompositeByteBuf maxNumComponents.
Click Source Link
From source file:io.servicecomb.foundation.vertx.tcp.TcpConnection.java
License:Apache License
protected void writeInContext() { CompositeByteBuf cbb = ByteBufAllocator.DEFAULT.compositeBuffer(); for (;;) {/*from w w w. ja v a 2 s. co m*/ ByteBuf buf = writeQueue.poll(); if (buf == null) { break; } writeQueueSize.decrementAndGet(); cbb.addComponent(true, buf); if (cbb.numComponents() == cbb.maxNumComponents()) { netSocket.write(Buffer.buffer(cbb)); cbb = ByteBufAllocator.DEFAULT.compositeBuffer(); } } if (cbb.isReadable()) { netSocket.write(Buffer.buffer(cbb)); } }