Package io.fletty.bootstrap

Examples of io.fletty.bootstrap.Bootstrap


        }
        channel.writeAndFlush(data + "\n");
    }

    protected void _connect(String host, int port) {
        Bootstrap b = new Bootstrap();

        if (!context.addGroup(b)) {
            Flog.warn("no loopgroup, will not reconnect");
            return;
        }
        b.channel(NioSocketChannel.class);
        b.option(ChannelOption.SO_KEEPALIVE, true);
        b.option(ChannelOption.TCP_NODELAY, true);
        b.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 15*1000);
        b.handler(new FlooChannelInitializer(this));

        try {
            ChannelFuture connect = b.connect(host, port);
            channel = connect.channel();
        }   catch (RejectedExecutionException e) {
            context.errorMessage("Can not connect to floobits!");
            context.shutdown();
        }   catch (Throwable e) {
View Full Code Here

TOP

Related Classes of io.fletty.bootstrap.Bootstrap

Copyright © 2018 www.massapicom. 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.