this will receive data and convert it into a message, really this is more
        of an internal method, it is used in recv_callback and recv_msg
760460
def recv(self, timeout=0, **kwargs):
        """"""
        opcode, data = self.recv_raw(timeout, [websocket.ABNF.OPCODE_TEXT], **kwargs)
        return self.get_fetch_response(data)
399038
def receive_message(msg)
      response = Oj.load(msg.data)
      # this check is important in case a request timeout and we make new ones after
      if response['requestId'] == @request_id
        if @response.nil?
          @response = response
        else
          @response['result']['data'].concat response['result']['data']
          @response['result']['meta'].merge! response['result']['meta']
          @response['status'] = response['status']
        end
      end
    end
767162
function receive(msg) {
  var requests = [];
  var responses = [];

  if (!this.active) {
    return this;
  }

  // If we got JSON, parse it
  if (typeof msg === 'string') {
    try {
      msg = JSON.parse(msg);
    } catch (e) {
      // The specification doesn't force us to respond in error, ignoring
      return this;
    }
  }

  // If we get a standard single-type batch, dispatch it
  if (msg.constructor === Array) {
    if (msg.length === 0) {
      return this;
    }
    // Hint of request batch
    if (typeof msg[0].method === 'string') {
      requests = msg;
    } else {
      responses = msg;
    }
  } else if (typeof msg === 'object') {
    // Could we be a 'dual-batch' extended message?
    if (
      typeof msg.requests !== 'undefined'
      && typeof msg.responses !== 'undefined'
    ) {
      requests = msg.requests;
      responses = msg.responses;
    } else if (typeof msg.method === 'string') {
      // We're a single request
      requests.push(msg);
    } else {
      // We must be a single response
      responses.push(msg);
    }
  }

  responses.forEach(deliverResponse.bind(this));
  requests.forEach(serveRequest.bind(this));
  return this;
}
910553
function sendMessage (client, data, batchCallback) {
  var msg = data.msg;
  var offset = data.offset;
  var length = data.length;
  var port = data.port;
  var address = data.address;
  var callback = data.callback;

  client.send(msg, offset, length, port, address, function(err) {
    try {
      callback(err);
    } finally {
      batchCallback();
    }
  });
}
401023
def recv_msg(self):
        ''''''
        self.pre_message()
        s = self.recv()
        if len(s) > 0:
            if self.first_byte:
                self.auto_mavlink_version(s)

        m = self.mav.parse_char(s)
        if m is not None:
            self.post_message(m)

        return m
1169317
function receive ( str ){
    ping(); // clear/schedule next ping
    var msg = typeof str === 'string' ? JSON.parse( str ) : str;
    b9.emit('rtm.read', msg, replyTo( null ) );
    // acknowledge that a pending message was sent successfully
    if ( msg.reply_to ){
      delete pending[ msg.reply_to ];
    }
    else if ( msg.type != null ){
      b9.emit( msg.type, msg, replyTo( msg.channel ) );
    }
  }
1166096
def receive_stream_data(data)
      begin
        @buffer.extract(data).each do |line|
          parse_stream_line(line)
        end
        @stream  = ''
      rescue => e
        receive_error("#{e.class}: " + [e.message, e.backtrace].flatten.join("\n\t"))
        close_connection
        return
      end
    end
200650
def _recv_msg(self, mid_stream=False):
        
        try:
            msgbuf = self._recv_pkt()
        except BadResource as e:
            e.mid_stream = mid_stream
            raise
        except socket.timeout as e:
            # A timeout can leave the socket in an inconsistent state because
            # it might still receive the data later and mix up with a
            # subsequent request.
            # https://github.com/basho/riak-python-client/issues/425
            raise BadResource(e, mid_stream)
        mv = memoryview(msgbuf)
        mcb = mv[0:1]
        if self.bytes_required:
            mcb = mcb.tobytes()
        try:
            msg_code, = struct.unpack("B", mcb)
        except struct.error:
            # NB: Python 2.7.3 requires this
            # http://bugs.python.org/issue10212
            msg_code, = struct.unpack("B", mv[0:1].tobytes())
            self.bytes_required = True
        data = mv[1:].tobytes()
        return (msg_code, data)
1300643
function receive(node, config, socket, message) {

    message.socket = socket.id

    let data = botmgr.buildMessageFlow({ "message" : message }, {
        userId:     'message.socket', 
        convId:     'message.socket',
        payload:    'message.content',
        inputType:  'message.type',
        source:     CARRIER
    })
    

    if (data.message.type === "event") {
        if (data.message.content === "cmd-next") {
            node.warn({'next': data.message})
            return helper.emitEvent('endSound', node);
        }
    }
    else {
        node.warn({'received': data.message})

        // Handle Prompt
        let convId  = botmgr.getConvId(data)
        if (botmgr.hasDelayedCallback(convId, data.message)) return;
    }

    // Trigger received message
    helper.emitEvent('received', node, data, config);
    node.send(data);
}
399649
def _receive_callback(self, raw_message):
        """"""
        message = self.backend.message_to_python(raw_message)

        if self.auto_ack and not message.acknowledged:
            message.ack()
        self.receive(message.payload, message)
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)
34211
def receive_message(self, msg):
        """"""
        _LOGGER.debug('Starting X10Device.receive_message')
        if hasattr(msg, 'isack') and msg.isack:
            _LOGGER.debug('Got Message ACK')
            if self._send_msg_lock.locked():
                self._send_msg_lock.release()
        callbacks = self._message_callbacks.get_callbacks_from_message(msg)
        _LOGGER.debug('Found %d callbacks for msg %s', len(callbacks), msg)
        for callback in callbacks:
            _LOGGER.debug('Scheduling msg callback: %s', callback)
            self._plm.loop.call_soon(callback, msg)
        self._last_communication_received = datetime.datetime.now()
        _LOGGER.debug('Ending Device.receive_message')
487552
def receive_message(self):
        """"""
        with self.lock:
            assert self.can_receive_messages()
            message_type = self._read_message_type(self._file)
            message = message_type(self._file, self)
            self._message_received(message)
1172798
def _handle_message(self, data):
        
        if data.type == MSG_SERVER_SETTINGS:
            _LOGGER.info(data.payload)
        elif data.type == MSG_SAMPLE_FORMAT:
            _LOGGER.info(data.payload)
            self._connected = True
        elif data.type == MSG_TIME:
            if not self._buffered:
                _LOGGER.info('Buffering')
        elif data.type == MSG_HEADER:
            # Push to app source and start playing.
            _LOGGER.info(data.payload.codec.decode('ascii'))
            self._source.push(data.payload.header)
            self._source.play()
        elif data.type == MSG_WIRE_CHUNK:
            # Add chunks to play queue.
            self._buffer.put(data.payload.chunk)
            if self._buffer.qsize() > BUFFER_SIZE:
                self._buffered = True
            if self._buffer.empty():
                self._buffered = False
736009
def receive_message(self, message, data):
        
        if data[MESSAGE_TYPE] == TYPE_RECEIVER_STATUS:
            self._process_get_status(data)

            return True

        elif data[MESSAGE_TYPE] == TYPE_LAUNCH_ERROR:
            self._process_launch_error(data)

            return True

        return False
923613
def received(self, data):
        
        self.logger.debug('Data received: {}'.format(data))

        message_type = None

        if 'type' in data:
            message_type = data['type']

        if message_type == 'confirm_subscription':
            self._subscribed()
        elif message_type == 'reject_subscription':
            self._rejected()
        elif self.receive_callback is not None and 'message' in data:
            self.receive_callback(data['message'])
        else:
            self.logger.warning('Message type unknown. ({})'.format(message_type))
1256394
def _request(self, msg_type, msg_data=None):
    """"""
    msg = {}
    msg['type'] = msg_type
    if msg_data:
      msg['data'] = msg_data

    done = False
    tries = 0
    while not done and tries < MAX_RETRIES:
      try:
        MessageSocket.send(self, self.sock, msg)
        done = True
      except socket.error as e:
        tries += 1
        if tries >= MAX_RETRIES:
          raise
        print("Socket error: {}".format(e))
        self.sock.close()
        self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        self.sock.connect(self.server_addr)

    logging.debug("sent: {0}".format(msg))
    resp = MessageSocket.receive(self, self.sock)
    logging.debug("received: {0}".format(resp))
    return resp