code: public void closeSession(SocketAddress endpoint, boolean reconnect) {
          synchronized (lock) {
              // Submit a reconnect task for this address if one is not already present
              if (pendingConnections.containsKey(endpoint)) {
                  final ReconnectTask task = pendingConnections.get(endpoint);
                  if (task != null) {
                      task.stop();
                  }
              } else {
                  final IoSession ioSession = sessions.get(endpoint);
                  if (ioSession != null) {
                      close(ioSession, reconnect);
                  }
              }
          }
      }
docs: If there is an active session to the specified endpoint, it will be closed
  If not the reconnection task for the endpoint will be stopped
  
  @param endpoint
  @param reconnect whether to reconnect after closing the current session.
  Only used if the session is active