Send a message through Fleetspeak.

    Args:
      message: A message protocol buffer.
    Returns:
      Size of the message in bytes.
    Raises:
      ValueError: If message is not a common_pb2.Message.
500764
def Send(self, message):
    
    if not isinstance(message, common_pb2.Message):
      raise ValueError("Send requires a fleetspeak.Message")

    if message.destination.service_name == "system":
      raise ValueError(
          "Only predefined messages can have destination.service_name == \"system\"")

    return self._SendImpl(message)
1146142
def message(self, msg):
        
        for broker in self.message_brokers:
            try:
                broker(msg)
            except Exception as exc:
                utils.error(exc)
562358
def sendmess(self, msgtype, payload, flags=0, size=0, offset=0, timeout=0):
        

        flags |= self.flags
        assert not (flags & FLG_PERSISTENCE)

        with self._new_connection() as conn:
            ret, _, data = conn.req(
                msgtype, payload, flags, size, offset, timeout)

        return ret, data
858150
def receive_message(self):
        
        # split frames
        while len(self._read_buffer) >= INT_SIZE_IN_BYTES:
            frame_length = struct.unpack_from(FMT_LE_INT, self._read_buffer, 0)[0]
            if frame_length > len(self._read_buffer):
                return
            message = ClientMessage(memoryview(self._read_buffer)[:frame_length])
            self._read_buffer = self._read_buffer[frame_length:]
            self._builder.on_message(message)
611094
def send_message(msg)
      # Build the message and get it's size
      message = msg.serialize_to_string
      message_size = [message.length].pack('N')

      # Try to send the message
      try_again = true
      begin
        data = ""
        @ssl_client.write(message_size + message)
        @ssl_client.readpartial(1000,data)
      rescue
        # Sometimes our connection might drop or something, so
        # we'll reconnect to the unit and try to send the message again.
        if try_again
          try_again = false
          connect_to_unit
          retry
        else
          # Looks like we couldn't connect to the unit after all.
          puts "message not sent"
        end
      end

      return data
    end
161994
def message(message_type, payload, payload_length):
    
    return packet.build(
        Container(
            type=message_type,
            id=1,
            refer=0,
            sent=Container(
                secs=0,
                usecs=0
            ),
            recv=Container(
                secs=0,
                usecs=0
            ),
            payload_length=payload_length,
            payload=payload
        )
    )
114099
def send_message(self, target, content, uid=None):
        
        # Compute maximum length of payload
        prefix = "PRIVMSG {0} :".format(target)
        single_prefix = self._make_line("MSG:")
        single_prefix_len = len(single_prefix)
        max_len = 510 - len(prefix)

        content_len = len(content)
        if (content_len + single_prefix_len) < max_len:
            # One pass message
            self._connection.send_raw("{0}{1}{2}" \
                                       .format(prefix, single_prefix, content))

        else:
            # Multiple-passes message
            uid = uid or str(uuid.uuid4()).replace('-', '').upper()
            prefix = "{0}{1}:".format(prefix, self._make_line(uid))
            max_len = 510 - len(prefix)

            self._connection.privmsg(target, self._make_line(uid, "BEGIN"))

            for chunk in chunks(content, max_len):
                self._connection.send_raw(''.join((prefix, chunk)))

            self._connection.privmsg(target, self._make_line(uid, "END"))
568435
def on_message(self, client_conn, msg):
        
        MAX_QUEUE_SIZE = 30
        if len(self._msg_queue) >= MAX_QUEUE_SIZE:
            # This should never happen if callers to handle_message wait
            # for its futures to resolve before sending another message.
            # NM 2014-10-06: Except when there are multiple clients. Oops.
            raise RuntimeError('MessageHandlerThread unhandled '
                               'message queue full, not handling message')
        ready_future = Future()
        self._msg_queue.append((ready_future, client_conn, msg))
        self._wake.set()
        return ready_future
207365
def send_message(self, message, sign=True):
		
		if sign:
			message.sign(self.authenticators[self.defauth])
		logger.debug("sending %s", LazyStr(message.dump_oneline))
		self.transport.write(message.as_string())
1126888
def send_message(self, message):
        
        for handler in self.users:
            logging.info('Handler: ' + str(handler))
            handler.write_message(message)
1038709
def send(self, message):  # usually a json string...
        
        for transport in self.transports.values():
            transport.protocol.sendMessage(message)
1210676
def SendGrrMessageThroughFleetspeak(grr_id, msg):
  """"""
  fs_msg = fs_common_pb2.Message(
      message_type="GrrMessage",
      destination=fs_common_pb2.Address(
          client_id=GRRIDToFleetspeakID(grr_id), service_name="GRR"))
  fs_msg.data.Pack(msg.AsPrimitiveProto())
  fleetspeak_connector.CONN.outgoing.InsertMessage(fs_msg)
691321
def send(self, message):
        
        if not isinstance(message, (Msg, MsgProto)):
            raise ValueError("Expected Msg or MsgProto, got %s" % message)

        if self.steam_id:
            message.steamID = self.steam_id
        if self.session_id:
            message.sessionID = self.session_id

        if self.verbose_debug:
            self._LOG.debug("Outgoing: %s\n%s" % (repr(message), str(message)))
        else:
            self._LOG.debug("Outgoing: %s", repr(message))

        data = message.serialize()

        if self.channel_key:
            if self.channel_hmac:
                data = crypto.symmetric_encrypt_HMAC(data, self.channel_key, self.channel_hmac)
            else:
                data = crypto.symmetric_encrypt(data, self.channel_key)

        self.connection.put_message(data)
28003
def sendmess(self, msgtype, payload, flags=0, size=0, offset=0, timeout=0):
        

        # reuse last valid connection or create new
        conn = self.conn or self._new_connection()
        # invalidate last connection
        self.conn = None

        flags |= self.flags
        assert (flags & FLG_PERSISTENCE)
        ret, rflags, data = conn.req(
            msgtype, payload, flags, size, offset, timeout)
        if rflags & FLG_PERSISTENCE:
            # persistence granted, save connection object for reuse
            self.conn = conn
        else:
            # discard connection object
            conn.shutdown()

        return ret, data
553794
def send(self, message):
        
        try:
            self.ws.send(json.dumps(message))
        except websocket._exceptions.WebSocketConnectionClosedException:
            raise SelenolWebSocketClosedException()
285798
def send(self, message):
        """"""
        if not message or not self.protocol or not self.protocol.transport:
            return
        if not self.can_log:
            _LOGGER.debug('Sending %s', message.strip())
        try:
            self.protocol.transport.write(message.encode())
        except OSError as exc:
            _LOGGER.error(
                'Failed writing to transport %s: %s',
                self.protocol.transport, exc)
            self.protocol.transport.close()
            self.protocol.conn_lost_callback()
635770
async def message(self, target, message):
        
        hostmask = self._format_user_mask(self.nickname)
        # Leeway.
        chunklen = protocol.MESSAGE_LENGTH_LIMIT - len(
            '{hostmask} PRIVMSG {target} :'.format(hostmask=hostmask, target=target)) - 25

        for line in message.replace('\r', '').split('\n'):
            for chunk in chunkify(line, chunklen):
                # Some IRC servers respond with "412 Bot :No text to send" on empty messages.
                await self.rawmsg('PRIVMSG', target, chunk or ' ')