Can you elaborate a bit on the problem/issue you are facing? thanks ashish
On Sat, Oct 31, 2009 at 8:51 PM, Aleksandar Lazic <al-m...@none.at> wrote: > Dear List, > > what is 'better' the > > KeepAliveFilter > > or in the handler the sessionIdle() method? > > I have try to use the keepalive filter but I wasn't very successful ;-( > > ### main > KeepAliveFilter filter = new KeepAliveFilter(new > CommendKeepAliveMessageFactory()); > filter.setForwardEvent(true); > > // Create TCP/IP connector. > NioSocketConnector connector = new NioSocketConnector(); > connector.getFilterChain().addFirst("logging", new LoggingFilter()); > connector.getFilterChain().addLast("keep-alive", filter); > connector.setConnectTimeoutMillis(20); > connector.setHandler(new Commend2SNAPHandler()); > > ConnectFuture future = connector.connect( > new InetSocketAddress("10.10.10.199",17000)); > future.await(); > System.out.println("fu-isConn " + future.isConnected()); > if(future.isConnected()){ > IoSession sessin = future.getSession(); > }else{ > future.cancel(); > connector.dispose(); > System.exit(0); > } > ### > > attached the CommendKeepAliveMessageFactory file. > > Many thanks for help. > > BR > > Aleks -- thanks ashish Blog: http://www.ashishpaliwal.com/blog My Photo Galleries: http://www.pbase.com/ashishpaliwal