@Override
	public final void onSessionClosed(Session session) {
		this.hsClient.getConnector().removeSession(session);
		HandlerSocketSession hSession = (HandlerSocketSession) session;

		hSession.destroy();
		if (this.hsClient.getConnector().isStarted()
				&& hSession.isAllowReconnect()) {
			this.reconnect(session);
		}
		for (HSClientStateListener listener : this.hsClient
				.getHSClientStateListeners()) {
			listener.onDisconnected(this.hsClient, session
					.getRemoteSocketAddress());
		}
	}
@ Override public final void onSessionClosed ( Session session ) { this . hsClient . getConnector ( ) . removeSession ( session ) ; HandlerSocketSession hSession = ( HandlerSocketSession ) session ; hSession . destroy ( ) ; if ( this . hsClient . getConnector ( ) . isStarted ( ) && hSession . isAllowReconnect ( ) ) { this . reconnect ( session ) ; } for ( HSClientStateListener listener : this . hsClient . getHSClientStateListeners ( ) ) { listener . onDisconnected ( this . hsClient , session . getRemoteSocketAddress ( ) ) ; } }
Check if have to reconnect on session closed