It seems Server side disconnect client. Can you give ue some codes for server
side?
> Date: Thu, 30 Jul 2009 19:28:23 +0800
> Subject: reconnect the server?
> From: [email protected]
> To: [email protected]
>
> Hi, I wirte a Long connection client, it's sample code as:
> public void startClient() throws Exception {
> NioSocketConnector socketConnector = new NioSocketConnector();
> socketConnector.setHandler(.......);
> .........................................................................
> ConnectFuture future = socketConnector.connect(new InetSocketAddress(ip ,
> port));
> future.awaitUninterruptibly();
> }
>
> I implement IoHandler interface, in sessionClosed method, I try to
> reconnect the server side, it works, but still print "reconnect"
> characters,
> Can someone tell me if there is an error in my code?
> @Override
> public void sessionClosed(IoSession session) throws Exception {
> while ((session.getService() instanceof IoConnector) &&
> !
> ((IoConnector)session.getService()).connect(session.getRemoteAddress()).isConnected())
> {
> Thread.sleep( 5000 );
> log.warn("============reconnect===============");
> }
> }
> Thank you very much in advance
> Best regards
_________________________________________________________________
Messenger安全保护中心,免费修复系统漏洞,保护Messenger安全!
http://im.live.cn/safe/