code: private void stopWaitForHandshake() {
          if (waitForHandshakeTask != null) {
              boolean cancelled = waitForHandshakeTask.cancel(true);
              waitForHandshakeTask = null;
              if (cancelled && log.isDebugEnabled()) {
                  log.debug("waitForHandshake was cancelled for {}", sessionId);
              }
          }
      }
docs: Cancels wait for handshake task.