List of usage examples for io.netty.bootstrap AbstractBootstrap option
public <T> B option(ChannelOption<T> option, T value)
From source file:com.github.mrstampy.kitchensync.netty.Bootstrapper.java
License:Open Source License
/** * Sets the default bootstrap options (SO_BROADCAST=true, SO_REUSEADDR=true) * and the initializer as the channel handler. * * @param b//w w w . j av a2 s. c om * the b * @param initializer * the initializer */ protected void setDefaultBootstrapOptions(AbstractBootstrap<?, ?> b, ChannelInitializer<?> initializer) { b.option(ChannelOption.SO_BROADCAST, true); b.option(ChannelOption.SO_REUSEADDR, true); b.handler(initializer); }
From source file:org.opencloudb.config.model.SystemConfig.java
License:Open Source License
public void setSocketParams(AbstractBootstrap<?, ?> bootstrap, boolean isFrontChannel) throws IOException { int sorcvbuf = 0; int sosndbuf = 0; int soNoDelay = 0; if (isFrontChannel) { sorcvbuf = getFrontsocketsorcvbuf(); sosndbuf = getFrontsocketsosndbuf(); soNoDelay = getFrontSocketNoDelay(); } else {/*from w w w. j a v a 2 s .c o m*/ sorcvbuf = getBacksocketsorcvbuf(); sosndbuf = getBacksocketsosndbuf(); soNoDelay = getBackSocketNoDelay(); } bootstrap.option(ChannelOption.SO_RCVBUF, sorcvbuf); bootstrap.option(ChannelOption.SO_SNDBUF, sosndbuf); bootstrap.option(ChannelOption.TCP_NODELAY, soNoDelay == 1); bootstrap.option(ChannelOption.SO_KEEPALIVE, true); bootstrap.option(ChannelOption.SO_REUSEADDR, true); bootstrap.option(ChannelOption.WRITE_BUFFER_HIGH_WATER_MARK, 1024 * 1024); }
From source file:reactor.ipc.netty.options.NettyOptions.java
License:Open Source License
static void defaultNettyOptions(AbstractBootstrap<?, ?> bootstrap) { bootstrap.option(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT); }