Sends a cancel request to the server.

        Switches connection to IN_CANCEL state.
480645
def put_cancel(self):
        
        logger.info('Sending CANCEL')
        self._writer.begin_packet(tds_base.PacketType.CANCEL)
        self._writer.flush()
        self.in_cancel = 1
702714
public function cancel()
    {
        $data = $this->twisto->requestJson('POST', 'invoice/' . urlencode($this->invoice_id) . '/cancel/');
        $this->deserialize($data);
    }
387631
@SuppressWarnings("unchecked")
  private <T extends Request> void resendRequest(Throwable cause, T request, BiFunction sender, Connection connection, CompletableFuture future) {
    // If the connection has not changed, reset it and connect to the next server.
    if (this.connection == connection) {
      LOGGER.trace("{} - Resetting connection. Reason: {}", id, cause);
      this.connection = null;
      connection.close();
    }

    // Create a new connection and resend the request. This will force retries to piggyback on any existing
    // connect attempts.
    connect().whenComplete((c, e) -> sendRequest(request, sender, c, e, future));
  }
387075
def abort(self):
        
        if self.transport:
            self.transport.abort()
        self.event('connection_lost').fire()
1163917
def timeout(self, timeout):
        '''
        '''
        if self._timeout is None:
            self.event('connection_made').bind(self._add_timeout)
            self.event('connection_lost').bind(self._cancel_timeout)
        self._timeout = timeout or 0
        self._add_timeout(None)
262681
public void cancelCancellable() {

        if (timeoutMessageCancellable != null) {
            timeoutMessageCancellable.cancel();
        }
        if (getResponseFuture() != null && !getResponseFuture().isDone()) {
            getResponseFuture().cancel(true);
        }
    }
29186
private final void cancelCancellable() {
        if (timeoutMessageCancellable != null
                && !timeoutMessageCancellable.isCancelled()) {
            timeoutMessageCancellable.cancel();
        }
        if (pollMessageCancellable != null
                && !pollMessageCancellable.isCancelled()) {
            pollMessageCancellable.cancel();
        }
    }
7429
private void cancelStream(ChannelHandlerContext ctx, CancelClientStreamCommand cmd,
      ChannelPromise promise) {
    NettyClientStream.TransportState stream = cmd.stream();
    Status reason = cmd.reason();
    if (reason != null) {
      stream.transportReportStatus(reason, true, new Metadata());
    }
    if (!cmd.stream().isNonExistent()) {
      encoder().writeRstStream(ctx, stream.id(), Http2Error.CANCEL.code(), promise);
    } else {
      promise.setSuccess();
    }
  }
64584
def cancel(self):
        
        self._transaction = False
        try:
            cancel = self._con.cancel
        except AttributeError:
            pass
        else:
            cancel()
397324
def cancel_confirmation(self, confirmation_id):
        
        return self._create_put_request(
            resource=CONFIRMATIONS,
            billomat_id=confirmation_id,
            command=CANCEL,
        )
758241
def cancel(self, msg='', exc_type=CancelledError):
        
        _ret = False
        if not self.is_done():
            self.notify_cancelled(msg, True)
            _ret = True

        return _ret
74506
public synchronized void cancel() {
        // If the packet collector has already been cancelled, do nothing.
        if (cancelled) {
            return;
        }

        cancelled = true;
        connection.removeStanzaCollector(this);
        notifyAll();

        if (collectorToReset != null) {
            collectorToReset.cancel();
        }
    }
507283
def cancelRequest(self, requestId, reason=None, _=None):
        
        if reason is None:
            reason = CancelledError()
        tReq = self.requests.pop(requestId)
        tReq.d.errback(reason)
894910
def send_request(req, &block)
      @last_response = @http.request(req.delete(:method), req.delete(:uri), req, &block)
    end
985916
def _abort(self) -> None:
        """"""
        self.client_terminated = True
        self.server_terminated = True
        if self.stream is not None:
            self.stream.close()  # forcibly tear down the connection
        self.close()
1119915
def stop(self):
        
        self.stopping = True
        # Cancel any outstanding request to our client
        if self._batch_send_d:
            self._batch_send_d.cancel()
        # Do we have to worry about our looping call?
        if self.batch_every_t is not None:
            # Stop our looping call, and wait for the deferred to be called
            if self._sendLooper is not None:
                self._sendLooper.stop()
        # Make sure requests that wasn't cancelled above are now
        self._cancel_outstanding()
        return self._sendLooperD or succeed(None)
166636
public function cancel() {
        switch ($this->state) {
            case self::STATE_SHEDULED:
                $this->state = self::STATE_NONE;
                $this->counter = 0;
                break;
        }
        return false;
    }