Dear All,<br>Did any one have implement Timeout, could you share to me, because i have failed to implement.<br>IdleStateEvent never raised in function handleUpstream; <br>Sample of my code :<br>Server Side<br><a href="http://log.info">log.info</a>("Start listening on " + ip + ":" + port);<br>
ChannelFactory factory =<br> new NioServerSocketChannelFactory(<br> Executors.newCachedThreadPool(),<br> Executors.newCachedThreadPool());<br><br> ServerBootstrap bootstrap = new ServerBootstrap(factory);<br>
<br> bootstrap.setPipelineFactory(new ConnPipelineFactory(this));<br> bootstrap.setOption("child.tcpNoDelay", true);<br> bootstrap.setOption("child.keepAlive", true);<br>
bootstrap.setOption("child.reuseAddress", true);<br> bootstrap.setOption("child.connectTimeoutMillis", 10000);<br><br> // Bind and start to accept incoming connections.<br>
InetAddress inet = InetAddress.getByName(ip); <br> bootstrap.bind(new InetSocketAddress(inet,port)); <br> <a href="http://log.info">log.info</a>("Finish listening on " + ip + ":" + port);<br>
<br><br>Client Side :<br>ChannelFactory factory = new NioClientSocketChannelFactory(<br> Executors.newCachedThreadPool(), Executors.newCachedThreadPool());<br>ClientBootstrap bootstrap = new ClientBootstrap(factory); <br>
bootstrap.setPipelineFactory(new ConnPipelineFactory(this)); <br> bootstrap.setOption("tcpNoDelay", true);<br> bootstrap.setOption("keepAlive", true); <br> bootstrap.setOption("reuseAddress", true);<br>
bootstrap.setOption("connectTimeoutMillis", 1000);<br><br>Trims <br><br>Reza Ginting<br>