Package io.netty.bootstrap

Examples of io.netty.bootstrap.Bootstrap.option()


     * {@inheritedDoc}
     */
    public void start(final int port, final CountDownLatch counter, final byte[] data) throws IOException {
        Bootstrap bootstrap = new Bootstrap();
        bootstrap.group(group);
        bootstrap.option(ChannelOption.SO_SNDBUF, 64 * 1024);
        bootstrap.option(ChannelOption.TCP_NODELAY, true);
        bootstrap.channel(NioSocketChannel.class);
        bootstrap.handler(new ChannelInitializer<SocketChannel>() {

            @Override
View Full Code Here


     */
    public void start(final int port, final CountDownLatch counter, final byte[] data) throws IOException {
        Bootstrap bootstrap = new Bootstrap();
        bootstrap.group(group);
        bootstrap.option(ChannelOption.SO_SNDBUF, 64 * 1024);
        bootstrap.option(ChannelOption.TCP_NODELAY, true);
        bootstrap.channel(NioSocketChannel.class);
        bootstrap.handler(new ChannelInitializer<SocketChannel>() {

            @Override
            protected void initChannel(SocketChannel ch) throws Exception {
View Full Code Here

            SocketAddress redisAddress = socketAddressSupplier.get();

            logger.debug("Connecting to Redis, address: " + redisAddress);

            final Bootstrap redisBootstrap = new Bootstrap().channel(NioSocketChannel.class).group(eventLoopGroup);
            redisBootstrap.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, (int) unit.toMillis(timeout));

            final ConnectionWatchdog watchdog = new ConnectionWatchdog(redisBootstrap, timer, socketAddressSupplier);

            redisBootstrap.handler(new ChannelInitializer<Channel>() {
                @Override
View Full Code Here

            }
        });

        if (redisURI.getSentinels().isEmpty() && LettuceStrings.isNotEmpty(redisURI.getHost())) {
            sentinelBootstrap.option(ChannelOption.CONNECT_TIMEOUT_MILLIS,
                    (int) redisURI.getUnit().toMillis(redisURI.getTimeout()));
            ChannelFuture connect = sentinelBootstrap.connect(redisURI.getResolvedAddress());
            logger.debug("Connecting to Sentinel, address: " + redisURI.getResolvedAddress());
            try {
                connect.sync();
View Full Code Here

            boolean connected = false;
            Exception causingException = null;
            for (RedisURI uri : redisURI.getSentinels()) {

                sentinelBootstrap.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, (int) uri.getUnit().toMillis(uri.getTimeout()));
                ChannelFuture connect = sentinelBootstrap.connect(uri.getResolvedAddress());
                logger.debug("Connecting to Sentinel, address: " + uri.getResolvedAddress());
                try {
                    connect.sync();
                    connected = true;
View Full Code Here

        }
       
        Bootstrap bootstrap = new Bootstrap();
        bootstrap.group(wg).channel(NioDatagramChannel.class);
        // We cannot set the child option here     
        bootstrap.option(ChannelOption.SO_REUSEADDR, configuration.isReuseAddress());
        bootstrap.option(ChannelOption.SO_SNDBUF, configuration.getSendBufferSize());
        bootstrap.option(ChannelOption.SO_RCVBUF, configuration.getReceiveBufferSize());
        bootstrap.option(ChannelOption.SO_BROADCAST, configuration.isBroadcast());
        bootstrap.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, configuration.getConnectTimeout());
       
View Full Code Here

       
        Bootstrap bootstrap = new Bootstrap();
        bootstrap.group(wg).channel(NioDatagramChannel.class);
        // We cannot set the child option here     
        bootstrap.option(ChannelOption.SO_REUSEADDR, configuration.isReuseAddress());
        bootstrap.option(ChannelOption.SO_SNDBUF, configuration.getSendBufferSize());
        bootstrap.option(ChannelOption.SO_RCVBUF, configuration.getReceiveBufferSize());
        bootstrap.option(ChannelOption.SO_BROADCAST, configuration.isBroadcast());
        bootstrap.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, configuration.getConnectTimeout());
       
        // TODO need to find the right setting of below option
View Full Code Here

        Bootstrap bootstrap = new Bootstrap();
        bootstrap.group(wg).channel(NioDatagramChannel.class);
        // We cannot set the child option here     
        bootstrap.option(ChannelOption.SO_REUSEADDR, configuration.isReuseAddress());
        bootstrap.option(ChannelOption.SO_SNDBUF, configuration.getSendBufferSize());
        bootstrap.option(ChannelOption.SO_RCVBUF, configuration.getReceiveBufferSize());
        bootstrap.option(ChannelOption.SO_BROADCAST, configuration.isBroadcast());
        bootstrap.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, configuration.getConnectTimeout());
       
        // TODO need to find the right setting of below option
        // only set this if user has specified
View Full Code Here

        bootstrap.group(wg).channel(NioDatagramChannel.class);
        // We cannot set the child option here     
        bootstrap.option(ChannelOption.SO_REUSEADDR, configuration.isReuseAddress());
        bootstrap.option(ChannelOption.SO_SNDBUF, configuration.getSendBufferSize());
        bootstrap.option(ChannelOption.SO_RCVBUF, configuration.getReceiveBufferSize());
        bootstrap.option(ChannelOption.SO_BROADCAST, configuration.isBroadcast());
        bootstrap.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, configuration.getConnectTimeout());
       
        // TODO need to find the right setting of below option
        // only set this if user has specified
        /*
 
View Full Code Here

        // We cannot set the child option here     
        bootstrap.option(ChannelOption.SO_REUSEADDR, configuration.isReuseAddress());
        bootstrap.option(ChannelOption.SO_SNDBUF, configuration.getSendBufferSize());
        bootstrap.option(ChannelOption.SO_RCVBUF, configuration.getReceiveBufferSize());
        bootstrap.option(ChannelOption.SO_BROADCAST, configuration.isBroadcast());
        bootstrap.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, configuration.getConnectTimeout());
       
        // TODO need to find the right setting of below option
        // only set this if user has specified
        /*
        if (configuration.getReceiveBufferSizePredictor() > 0) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.