List of usage examples for io.netty.channel ChannelConfig setWriteBufferHighWaterMark
ChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark);
Sets the high water mark of the write buffer.
From source file:io.advantageous.conekt.net.impl.ConnectionBase.java
License:Open Source License
public void doSetWriteQueueMaxSize(int size) { ChannelConfig config = channel.config(); int high = config.getWriteBufferHighWaterMark(); int newLow = size / 2; int newHigh = size; if (newLow >= high) { config.setWriteBufferHighWaterMark(newHigh); config.setWriteBufferLowWaterMark(newLow); } else {//from w w w . ja va 2 s . c o m config.setWriteBufferLowWaterMark(newLow); config.setWriteBufferHighWaterMark(newHigh); } }