Currently not doing anything with received messages.
486643
def receive_message(self, message, data):
        
        if data['type'] == TYPE_RESPONSE_STATUS:
            self.is_launched = True
        return True
1041580
def receive_message(self, msg):
        """"""
        _LOGGER.debug('Starting Device.receive_message')
        if hasattr(msg, 'isack') and msg.isack:
            _LOGGER.debug('Got Message ACK')
            if self._sent_msg_wait_for_directACK.get('callback') is not None:
                _LOGGER.debug('Look for direct ACK')
                asyncio.ensure_future(self._wait_for_direct_ACK(),
                                      loop=self._plm.loop)
            else:
                _LOGGER.debug('DA queue: %s',
                              self._sent_msg_wait_for_directACK)
                _LOGGER.debug('Message ACK with no callback')
        if (hasattr(msg, 'flags') and
                hasattr(msg.flags, 'isDirectACK') and
                msg.flags.isDirectACK):
            _LOGGER.debug('Got Direct ACK message')
            if self._send_msg_lock.locked():
                self._directACK_received_queue.put_nowait(msg)
            else:
                _LOGGER.debug('But Direct ACK not expected')
        if not self._is_duplicate(msg):
            callbacks = self._message_callbacks.get_callbacks_from_message(msg)
            for callback in callbacks:
                _LOGGER.debug('Scheduling msg callback: %s', callback)
                self._plm.loop.call_soon(callback, msg)
        else:
            _LOGGER.debug('msg is duplicate')
            _LOGGER.debug(msg)
        self._last_communication_received = datetime.datetime.now()
        _LOGGER.debug('Ending Device.receive_message')
1365634
def received_message(self, msg):
        
        logger.debug("Received message: %s", msg)
        if msg.is_binary:
            raise ValueError("Binary messages not supported")
        resps = json.loads(msg.data)

        cmd_group = _get_cmds_id(*resps)
        if cmd_group:
            (cmds, promise) = self._cmd_groups[cmd_group]
            promise.fulfill((cmds, resps))
        else:
            try:
                self.received_unsolicited(resps)
            except:
                logger.exception("Error in unsolicited msg handler")
                raise
866610
@Test
    public void message_polling_is_working() throws JMSException {
        testSender4.send("HELLO");

        try {
            count.await(5, TimeUnit.SECONDS);

            Assertions.assertThat(text).isEqualTo("HELLO");
        } catch (InterruptedException e) {
            fail("Thread interrupted");
        }
    }
1024597
private void checkMessage(Message msg) throws MessagingException {
        if (msg == null) {
            throw new MessagingException("Message is null");
        }
        if (!(msg instanceof MimeMessage)) {
            throw new MessagingException(
                    "AWS Mail Service can only send MimeMessages");
        }
    }
1197902
function NotImplemented(message, cause) {
    NotImplemented.super_.call(this, message, StatusCode.NOT_IMPLEMENTED, cause);
}
131241
def recv_msg(self):
        ''''''
        if self._index >= self._count:
            return None
        m = self._msgs[self._index]
        self._index += 1
        self.percent = (100.0 * self._index) / self._count
        self.messages[m.get_type()] = m
        return m
540736
private void ack() {
    // Send a message to the other side of the connection indicating the
    // last message that we received in order. This will allow it to
    // purge messages we've already received from its queue.
    if (open && connected) {
      if (log.isDebugEnabled()) {
        log.debug(String.format("%s - Acking messages up to: %d", this, lastReceived));
      }
      eventBus.send(outAddress, new JsonObject().putString("action", "ack").putNumber("id", lastReceived));
      lastFeedbackTime = System.currentTimeMillis();
    }
  }
404369
def _process_message(self, message: amqp.Message) -> None:
        """"""
        if self.shutdown_pending.is_set():
            return

        try:
            if isinstance(message.body, bytes):
                message.body = message.body.decode()
            description = json.loads(message.body)
        except Exception:
            logger.error("Cannot decode message. Dropping. Message: %r", message.body)
            traceback.print_exc()
            message.channel.basic_reject(message.delivery_tag, requeue=False)
        else:
            logger.info("Processing task: %r", description)
            self._process_description(message, description)
1055845
function onMessage(obj) {
    var id = obj.id;
    if (!self._matchesPrefix(id)) {
      debug('discarding unscoped message %s', id);
      return;
    }
    var cb = self._registry.get(id);
    if (cb) {
      process.nextTick(function () {
        debug('received message %s', id);
        // Ensure that the initial callback gets called asynchronously, even
        // for completely synchronous transports (otherwise the number of
        // pending requests will sometimes be inconsistent between stateful and
        // stateless transports).
        cb(null, Buffer.concat(obj.payload), self._adapter);
      });
    }
  }
877845
def reply(self, message):
        
        if self.sessionActive:
            return self._gsmModem.sendUssd(message)
        else:
            raise InvalidStateException('USSD session is inactive')
1269708
def on_message_received(self, msg):
        
        if self.is_stopped:
            raise RuntimeError("reader has already been stopped")
        else:
            self.buffer.put(msg)
1184090
@Test
    public void unmanaged_send_and_receive_is_working() throws JMSException {

        testSender2.send("UNMANAGED");

        try {
            unmanaged.await(1, TimeUnit.SECONDS);

            Assertions.assertThat(textUnmanaged).isEqualTo("UNMANAGED");
        } catch (InterruptedException e) {
            fail("Thread interrupted");
        }
    }
385349
def handleStatus(self, version, status, message):
        """"""

        self.status = status
        self.message = message
655141
def reset(self):
        
        self._monitor.notify_received()
        self._pinger.stop()
        self._mark_fresh()
1274490
async def get_message(self, ignore_subscribe_messages=False, timeout=0):
        
        response = await self.parse_response(block=False, timeout=timeout)
        if response:
            return self.handle_message(response, ignore_subscribe_messages)
        return None
675473
function (sender, msg) {
        if (!msg) {
            logger.log('onApiMessage - no message? got ' + JSON.stringify(arguments), { coreID: this.getHexCoreID() });
            return;
        }
        var that = this;

        //if we're not the owner, then the socket is busy
        var isBusy = (!this._checkOwner(null, function(err) {
            logger.error(err + ": " + msg.cmd , { coreID: that.getHexCoreID() });
        }));
        if (isBusy) {
            this.sendApiResponse(sender, { error: "This core is locked during the flashing process." });
            return;
        }

        //TODO: simplify this more?
        switch (msg.cmd) {
            case "Describe":

                if (isBusy) {
                    if (settings.logApiMessages) {
                        logger.log('Describe - flashing', { coreID: that.coreID });
                    }
                    that.sendApiResponse(sender, {
                        cmd: "DescribeReturn",
                        name: msg.name,
                        state: { f: [], v: [] },
                        product_id: that.spark_product_id,
                        firmware_version: that.product_firmware_version
                    });
                }
                else {
                    when(this.ensureWeHaveIntrospectionData()).then(
                        function () {
                            that.sendApiResponse(sender, {
                                cmd: "DescribeReturn",
                                name: msg.name,
                                state: that.coreFnState,
                                product_id: that.spark_product_id,
                                firmware_version: that.product_firmware_version
                            });
                        },
                        function (msg) {
                            that.sendApiResponse(sender, {
                                cmd: "DescribeReturn",
                                name: msg.name,
                                err: "Error, no device state"
                            });
                        }
                    );
                }

                break;
            case "GetVar":
                if (settings.logApiMessages) {
                    logger.log('GetVar', { coreID: that.coreID });
                }
                this.getVariable(msg.name, msg.type, function (value, buf, err) {

                    //don't forget to handle errors!
                    //if 'error' is set, then don't return the result.
                    //so we can correctly handle "Variable Not Found"

                    that.sendApiResponse(sender, {
                        cmd: "VarReturn",
                        name: msg.name,
                        error: err,
                        result: value
                    });

                });
                break;
            case "SetVar":
                if (settings.logApiMessages) {
                    logger.log('SetVar', { coreID: that.coreID });
                }
                this.setVariable(msg.name, msg.value, function (resp) {

                    //that.sendApiResponse(sender, resp);

                    var response = {
                        cmd: "VarReturn",
                        name: msg.name,
                        result: resp.getPayload().toString()
                    };
                    that.sendApiResponse(sender, response);
                });
                break;
            case "CallFn":
                if (settings.logApiMessages) {
                    logger.log('FunCall', { coreID: that.coreID });
                }
                this.callFunction(msg.name, msg.args, function (fnResult) {
                    var response = {
                        cmd: "FnReturn",
                        name: msg.name,
                        result: fnResult,
                        error: fnResult.Error
                    };

                    that.sendApiResponse(sender, response);
                });
                break;
            case "UFlash":
                if (settings.logApiMessages) {
                    logger.log('FlashCore', { coreID: that.coreID });
                }

                this.flashCore(msg.args.data, sender);
                break;

            case "FlashKnown":
                if (settings.logApiMessages) {
                    logger.log('FlashKnown', { coreID: that.coreID, app: msg.app });
                }

                // Responsibility for sanitizing app names lies with API Service
                // This includes only allowing apps whose binaries are deployed and thus exist
                fs.readFile('known_firmware/' + msg.app + '_' + settings.environment + '.bin', function (err, buf) {
                    if (err) {
                        logger.log("Error flashing known firmware", { coreID: that.coreID, err: err });
                        that.sendApiResponse(sender, { cmd: "Event", name: "Update", message: "Update failed - " + JSON.stringify(err) });
                        return;
                    }

                    that.flashCore(buf, sender);
                });
                break;

            case "RaiseHand":
                if (isBusy) {
                    if (settings.logApiMessages) {
                        logger.log('SignalCore - flashing', { coreID: that.coreID });
                    }
                    that.sendApiResponse(sender, { cmd: "RaiseHandReturn", result: true });
                }
                else {
                    if (settings.logApiMessages) {
                        logger.log('SignalCore', { coreID: that.coreID });
                    }

                    var showSignal = (msg.args && msg.args.signal);
                    this.raiseYourHand(showSignal, function (result) {
                        that.sendApiResponse(sender, {
                            cmd: "RaiseHandReturn",
                            result: result
                        });
                    });
                }

                break;
            case "Ping":
                if (settings.logApiMessages) {
                    logger.log('Pinged, replying', { coreID: that.coreID });
                }

                this.sendApiResponse(sender, { cmd: "Pong", online: (this.socket != null), lastPing: this._lastCorePing });
                break;
            default:
                this.sendApiResponse(sender, {error: "unknown message" });
        }
    }