Send an abort sequence using CAN bytes.
338562
def abort(self, count=2, timeout=60):
        '''
        
        '''
        for counter in xrange(0, count):
            self.putc(CAN, timeout)
933780
function send(err, reply, cb) {

  // invoke before function, used to end a slowlog
  // timer before sending output
  if(this.before) this.before();

  if(this.cb) {
    return this.cb(err, reply);
  }
  this.conn.write(err || reply, cb);
}
153866
def send_packed_command(self, command):
        ""
        if not self._sock:
            self.connect()
        try:
            if isinstance(command, str):
                command = [command]
            for item in command:
                self._sock.sendall(item)
        except socket.timeout:
            self.disconnect()
            raise TimeoutError("Timeout writing to socket")
        except socket.error:
            e = sys.exc_info()[1]
            self.disconnect()
            if len(e.args) == 1:
                errno, errmsg = 'UNKNOWN', e.args[0]
            else:
                errno = e.args[0]
                errmsg = e.args[1]
            raise ConnectionError("Error %s while writing to socket. %s." %
                                  (errno, errmsg))
        except:  # noqa: E722
            self.disconnect()
            raise
1238033
def _no_answer_do_retry(self, pk, pattern):
        """"""
        logger.info('Resending for pattern %s', pattern)
        # Set the timer to None before trying to send again
        self.send_packet(pk, expected_reply=pattern, resend=True)
969817
def flexifunction_command_ack_send(self, command_type, result, force_mavlink1=False):
                '''
                

                '''
                return self.send(self.flexifunction_command_ack_encode(command_type, result), force_mavlink1=force_mavlink1)
48702
def sendOACK(self):
        """"""
        log.debug("In sendOACK with options %s", self.context.options)
        pkt = TftpPacketOACK()
        pkt.options = self.context.options
        self.context.sock.sendto(pkt.encode().buffer,
                                 (self.context.host,
                                  self.context.tidport))
        self.context.last_pkt = pkt
564756
async def send(self, message: Union[str, bytes],
                   binary: bool=False,
                   compress: Optional[int]=None) -> None:
        """"""
        if isinstance(message, str):
            message = message.encode('utf-8')
        if binary:
            await self._send_frame(message, WSMsgType.BINARY, compress)
        else:
            await self._send_frame(message, WSMsgType.TEXT, compress)
916943
def __handle_low_seq_resend(self, msg, req):
        """"""
        if msg[M_TYPE] == E_FAILED and msg[M_PAYLOAD][P_CODE] == E_FAILED_CODE_LOWSEQNUM:
            with self.__seqnum_lock:
                self.__seqnum = int(msg[M_PAYLOAD][P_MESSAGE])
            # return value indicating shutdown not useful here since this is run in receiver thread
            self.__retry_enqueue(PreparedMessage(req._inner_msg_out, req.id_))
            return True
        return False
1032704
def SendVerack(self):
        """"""
        m = Message('verack')
        self.SendSerializedMessage(m)
        self.expect_verack_next = True
1170041
def _send_loop(self):
        """"""
        while True:
            message, response_queue = self._send_queue.get()
            if message is self.STOP:
                break
            try:
                self._response_queues.put(response_queue)
                self._socket.send(message)
            except Exception:  # pylint:disable=broad-except
                log.exception("Exception sending message %s", message)
848760
def _send_command(self, cmd_class, command, payload, timeout=3.0):
        

        if len(payload) > 60:
            return ValueError("Attempting to send a BGAPI packet with length > 60 is not allowed", actual_length=len(payload), command=command, command_class=cmd_class)

        header = bytearray(4)
        header[0] = 0
        header[1] = len(payload)
        header[2] = cmd_class
        header[3] = command

        packet = header + bytearray(payload)
        self._stream.write(bytes(packet))

        #Every command has a response so wait for the response here
        response = self._receive_packet(timeout)
        return response
387075
def abort(self):
        
        if self.transport:
            self.transport.abort()
        self.event('connection_lost').fire()
913135
def wrapped_sendfile(act, offset, length):
    
    if sendfile:
        offset, sent = sendfile.sendfile(
            act.sock.fileno(),
            act.file_handle.fileno(),
            offset, length
        )
    else:
        act.file_handle.seek(offset)
        sent = act.sock._fd.send(act.file_handle.read(length))
    return sent
418696
def _send_ffe(self, pid, app_id, app_flags, fr):
        
        arg1 = (NNCommands.flood_fill_end << 24) | pid
        arg2 = (app_id << 24) | (app_flags << 18)
        self._send_scp(255, 255, 0, SCPCommands.nearest_neighbour_packet,
                       arg1, arg2, fr)
664898
def _send_start_ok(self):
        ''''''
        args = Writer()
        args.write_table(self.connection._properties)
        args.write_shortstr(self.connection._login_method)
        args.write_longstr(self.connection._login_response)
        args.write_shortstr(self.connection._locale)
        self.send_frame(MethodFrame(self.channel_id, 10, 11, args))

        self.add_synchronous_cb(self._recv_tune)
1237150
def send(self, data):
        """"""
        self._send_data(int_to_hex(len(data)))

        self._send_data(data)
989734
def abort(self, err):
        """"""
        if _debug: IOQController._debug("abort %r", err)

        if (self.state == CTRL_IDLE):
            if _debug: IOQController._debug("    - idle")
            return

        while True:
            iocb = self.ioQueue.get(block=0)
            if not iocb:
                break
            if _debug: IOQController._debug("    - iocb: %r", iocb)

            # change the state
            iocb.ioState = ABORTED
            iocb.ioError = err

            # notify the client
            iocb.trigger()

        if (self.state != CTRL_IDLE):
            if _debug: IOQController._debug("    - busy after aborts")