Example usage for io.netty.channel ChannelConfig setWriteBufferHighWaterMark

List of usage examples for io.netty.channel ChannelConfig setWriteBufferHighWaterMark

Introduction

In this page you can find the example usage for io.netty.channel ChannelConfig setWriteBufferHighWaterMark.

Prototype

ChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark);

Source Link

Document

Sets the high water mark of the write buffer.

Usage

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);
    }
}