send message to server
179579
def _send_msg(self, header, payload):
        """"""

        if self.verbose:
            print('->', repr(header))
            print('..', repr(payload))
        assert header.payload == len(payload)
        try:
            sent = self.socket.send(header + payload)
        except IOError as err:
            raise ConnError(*err.args)

        # FIXME FIXME FIXME:
        # investigate under which situations socket.send should be retried
        # instead of aborted.
        # FIXME FIXME FIXME
        if sent < len(header + payload):
            raise ShortWrite(sent, len(header + payload))
        assert sent == len(header + payload), sent
271695
def send(self, msg):
        """"""
        assert isinstance(msg, str), "String is required"

        if self._debug:
            log.info("outgoing message: %s, %s", self.id, str(msg)[:200])

        if self.state != STATE_OPEN:
            return

        self._feed(FRAME_MESSAGE, msg)
235064
def send_message(msg, type = 'TextMessage')
      connect do |http|
        request = http_request(:post, "/room/#{room_id}/speak.json")
        request.body = { :message => { :body => msg, :type => type } }.to_json
        response = http.request(request)

        case response
        when Net::HTTPCreated
          true
        else
          raise ConnectionError,
            "Error sending message '#{msg}' (#{response.class})"
        end
      end
    end
312923
def send_response(self, msgid, response):
        """"""
        msg = dumps([2, msgid, response])
        self.send(msg)
936545
def send(self, command, message=None):
        ''''''
        if message:
            joined = command + constants.NL + util.pack(message)
        else:
            joined = command + constants.NL
        if self._blocking:
            for sock in self.socket():
                sock.sendall(joined)
        else:
            self._pending.append(joined)
403071
function Channel_sendMessage(message) {
  if (!this._wsConn) return

  DEBUGMSG("sendMessage", utils.JL(message))
  message = JSON.stringify(message)
  this._wsConn.sendUTF(message)
}
1126888
def send_message(self, message):
        
        for handler in self.users:
            logging.info('Handler: ' + str(handler))
            handler.write_message(message)
842964
def _send(self, message):
        
        if not message.recipients():
            return False
        try:
            self.connection.sendmail(
                message.sender,
                message.recipients(),
                message.message().as_string(),
            )
        except Exception as e:
            logger.error(
                "Error sending a message to server %s:%s: %s",
                self.host,
                self.port,
                e,
            )
            if not self.fail_silently:
                raise
            return False
        return True
961792
async def send(self, message_type, message_content, timeout=None):
        
        return await self._sender.send(
            message_type, message_content, timeout=timeout)
419651
def send_messages(self, messages, timeout):
        """"""
        data = {
            'assignment': self.assignment.endpoint,
            'messages': messages,
            'submit': self.args.submit
        }
        address = self.API_ENDPOINT
        address_params = {
            'client_name': 'ok-client',
            'client_version': client.__version__,
        }
        log.info('Sending messages to %s', address)
        try:
            response = requests.post(address,
                params=address_params, json=data, timeout=timeout)
            response.raise_for_status()
            return response.json()['url']
        except (requests.exceptions.RequestException, requests.exceptions.BaseHTTPError, ValueError) as ex:
            log.warning('%s: %s', ex.__class__.__name__, str(ex))
        return
629342
def sendMessage(self, message, thread_id=None, thread_type=ThreadType.USER):
        
        return self.send(
            Message(text=message), thread_id=thread_id, thread_type=thread_type
        )
1241285
def send_data(self, message):
        '''
            
        '''
        #logger.debug("TX:\n%s", json.dumps(message, indent=2))
        data = json.dumps(message).encode('utf-8') + b'\n'
        self.transport.write(data)
1038709
def send(self, message):  # usually a json string...
        
        for transport in self.transports.values():
            transport.protocol.sendMessage(message)
371257
function send() {
  var message = arguments.length <= 0 || arguments[0] === undefined ? 'hello mqtt-controls' : arguments[0];
  var topic = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1];

  var t = undefined;
  if (topic === null) {
    t = topics.publish;
  } else {
    t = topic;
  }
  client.publish(t, message);
}
990327
function Channel_sendMessage(message) {
  if (!this.wsConn) return
  if (!this.wsConn.connected) return

  DEBUGMSG("send: " + utils.JS(message))

  try {
    this.wsConn.sendUTF(JSON.stringify(message))
  }
  catch(e) {
    // occurs when socket closed, oh well
  }
}
491706
def send_message(self, *args, **kwargs):
        """"""
        return send_message(*args, **self._merge_overrides(**kwargs)).run()
192745
public function send()
    {
        $message = $this->message ?: ($this->task ? ucwords($this->getSystemUser()).' ran the ['.$this->task.'] task.' : ucwords($this->getSystemUser()).' ran a task.');

        $payload = array_merge(['text' => $message, 'channel' => $this->channel], $this->options);

        Request::post("{$this->hook}")->sendsJson()->body($payload)->send();
    }