Search in sources :

Example 1 with ServerSocketChannelFactory

use of org.graylog2.inputs.transports.netty.ServerSocketChannelFactory in project graylog2-server by Graylog2.

the class AbstractTcpTransport method getBootstrap.

protected ServerBootstrap getBootstrap(MessageInput input) {
    final LinkedHashMap<String, Callable<? extends ChannelHandler>> parentHandlers = getChannelHandlers(input);
    final LinkedHashMap<String, Callable<? extends ChannelHandler>> childHandlers = getChildChannelHandlers(input);
    childEventLoopGroup = eventLoopGroupFactory.create(workerThreads, localRegistry, "workers");
    return new ServerBootstrap().group(parentEventLoopGroup, childEventLoopGroup).channelFactory(new ServerSocketChannelFactory(nettyTransportConfiguration.getType())).option(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT).option(ChannelOption.RCVBUF_ALLOCATOR, new FixedRecvByteBufAllocator(8192)).option(ChannelOption.SO_RCVBUF, getRecvBufferSize()).childOption(ChannelOption.SO_RCVBUF, getRecvBufferSize()).childOption(ChannelOption.SO_KEEPALIVE, tcpKeepalive).handler(getChannelInitializer(parentHandlers)).childHandler(getChannelInitializer(childHandlers));
}
Also used : ServerSocketChannelFactory(org.graylog2.inputs.transports.netty.ServerSocketChannelFactory) FixedRecvByteBufAllocator(io.netty.channel.FixedRecvByteBufAllocator) ChannelHandler(io.netty.channel.ChannelHandler) ExceptionLoggingChannelHandler(org.graylog2.inputs.transports.netty.ExceptionLoggingChannelHandler) Callable(java.util.concurrent.Callable) ServerBootstrap(io.netty.bootstrap.ServerBootstrap)

Aggregations

ServerBootstrap (io.netty.bootstrap.ServerBootstrap)1 ChannelHandler (io.netty.channel.ChannelHandler)1 FixedRecvByteBufAllocator (io.netty.channel.FixedRecvByteBufAllocator)1 Callable (java.util.concurrent.Callable)1 ExceptionLoggingChannelHandler (org.graylog2.inputs.transports.netty.ExceptionLoggingChannelHandler)1 ServerSocketChannelFactory (org.graylog2.inputs.transports.netty.ServerSocketChannelFactory)1