Example usage for io.netty.channel WriteBufferWaterMark DEFAULT

List of usage examples for io.netty.channel WriteBufferWaterMark DEFAULT

Introduction

In this page you can find the example usage for io.netty.channel WriteBufferWaterMark DEFAULT.

Prototype

WriteBufferWaterMark DEFAULT

To view the source code for io.netty.channel WriteBufferWaterMark DEFAULT.

Click Source Link

Usage

From source file:com.ibasco.agql.core.transport.NettyTransport.java

License:Open Source License

public NettyTransport(ChannelType channelType, ExecutorService executor) {
    executorService = executor;/*w  w  w .jav a  2s  .  co  m*/
    bootstrap = new Bootstrap();

    //Make sure we have a type set
    if (channelType == null)
        throw new IllegalStateException("No channel type has been specified");

    //Pick the proper event loop group
    if (eventLoopGroup == null) {
        eventLoopGroup = createEventLoopGroup(channelType);
    }

    //Default Channel Options
    addChannelOption(ChannelOption.ALLOCATOR, allocator);
    addChannelOption(ChannelOption.WRITE_BUFFER_WATER_MARK, WriteBufferWaterMark.DEFAULT);
    addChannelOption(ChannelOption.CONNECT_TIMEOUT_MILLIS, 10000);

    //Set resource leak detection if debugging is enabled
    if (log.isDebugEnabled())
        ResourceLeakDetector.setLevel(ResourceLeakDetector.Level.ADVANCED);

    //Initialize bootstrap
    bootstrap.group(eventLoopGroup).channel(channelType.getChannelClass());
}