You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Chen, Guosong" <GC...@StateStreet.com> on 2010/06/03 05:04:27 UTC

Mina iosession can't be closed

Hi,
We have a middle ware system based on mina 1.17, jdk1.5_15, readhat enterprise 5, and I found 
strange things in log.

Server tries to close the session when it detected the message sending timeout,
Server joins on the ColseFuture until timeout and the session.isConnected still returns
true, so server keep sending messages to client, still sending timeout and operated
as the last time. This situation lasted for about 12 hours. 

Do anybody have any concerns about close session timeout and why the session can’t be closed for such a long time?

Here is the related code:
		if (sendMessageTimeout()) {
			// if send timeout, return false;
			// first close the socket
			logger.info("Detect a timeout on " + this);
			if (null != ioSession && ioSession.isConnected()) {
				CloseFuture cf = ioSession.close();
				
				if(cf.join(heartBeatInt))
				{
					logger.info("Close ioSession: " + this + " finished.");
					// after ioSession.close(), mina will do the next thing.
					retCode = false;
				}else{
					logger.info("Close ioSession timeout.");
				}
			}else{
				//the connection has already been closed.
				retCode = true;
			}
		}

-------------------------------------------------------------
CFETS Project Team
State Street Hangzhou
West Lake Science & Technology Economic Park
J3 Building, 1, Road 8, Xiyuan, San Dun, West Lake District
Hangzhou, China 310030
中国浙江省杭州市西湖区三墩镇西园8路1号西湖科技园区J3楼 310030
GChen2@statestreet.com
+86-571-28111768