<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def put_cancel(self):
 """ Sends a cancel request to the server. Switches connection to IN_CANCEL state. """

        logger.info('Sending CANCEL')
        self._writer.begin_packet(tds_base.PacketType.CANCEL)
        self._writer.flush()
        self.in_cancel = 1