code: @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());
  		}
  	}
docs: Check if have to reconnect on session closed