I am trying to make a netty connection for a project and I am successfully 
able to make it. However, after 30 seconds the connection becomes inactive. 
I'm purposefully not using the connection for something because it is a 
test connection but I want to keep it active for future tasks even after 30 
seconds are over. This is my code to create the connection:

try {
        Bootstrap b = new Bootstrap();
        b.option(ChannelOption.TCP_NODELAY, true);
        b.option(ChannelOption.SO_KEEPALIVE, true);
        b.group(new NioEventLoopGroup());
        b.channel(NioSocketChannel.class);
        b.handler(new ReadTimeoutHandler(50));

        InetSocketAddress sa = new InetSocketAddress("--------IP 
HIDDEN--------", 25454);
        ChannelFuture f = b.connect(sa.getAddress(), sa.getPort()).sync(); // 
(5)
        Channel chan = f.channel();
        //Channel becomes inactive after 30 seconds
    } catch (Exception e) {
        e.printStackTrace();
    }

-- 
You received this message because you are subscribed to the Google Groups 
"Netty discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to netty+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/netty/4e7f86a1-49a3-4111-a111-1c77d3ee4358%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to