def cancel_request(self, index, offset, length): with self._ready: self.cancel_messages(protocol.REQUEST, \ lambda msg: msg.index == index and msg.offset == offset and\ msg.length == length) self.add_message(protocol.cancel_message(\ index, offset, length))
def cancel(self, index, offset, length): self._out.add_message(protocol.cancel_message(\ index, offset, length))