Handles a received message
486142
def handle_message(self, connection, sender, target, message):
        
        parts = message.strip().split(' ', 2)
        if parts and parts[0].lower() == '!bot':
            try:
                command = parts[1].lower()
            except IndexError:
                self.safe_send(connection, target, "No command given")
                return

            try:
                payload = parts[2]
            except IndexError:
                payload = ""

            self.__pool.enqueue(self._handle_command,
                                connection, sender, target, command, payload)
738143
def handle_notification(self, data):
        """"""
        _LOGGER.debug("Received notification from the device..")

        if data[0] == PROP_INFO_RETURN and data[1] == 1:
            _LOGGER.debug("Got status: %s" % codecs.encode(data, 'hex'))
            status = Status.parse(data)
            _LOGGER.debug("Parsed status: %s", status)

            self._raw_mode = status.mode
            self._valve_state = status.valve
            self._target_temperature = status.target_temp

            if status.mode.BOOST:
                self._mode = Mode.Boost
            elif status.mode.AWAY:
                self._mode = Mode.Away
                self._away_end = status.away
            elif status.mode.MANUAL:
                if status.target_temp == EQ3BT_OFF_TEMP:
                    self._mode = Mode.Closed
                elif status.target_temp == EQ3BT_ON_TEMP:
                    self._mode = Mode.Open
                else:
                    self._mode = Mode.Manual
            else:
                self._mode = Mode.Auto

            _LOGGER.debug("Valve state: %s", self._valve_state)
            _LOGGER.debug("Mode:        %s", self.mode_readable)
            _LOGGER.debug("Target temp: %s", self._target_temperature)
            _LOGGER.debug("Away end:    %s", self._away_end)

        elif data[0] == PROP_SCHEDULE_RETURN:
            parsed = self.parse_schedule(data)
            self._schedule[parsed.day] = parsed

        else:
            _LOGGER.debug("Unknown notification %s (%s)", data[0], codecs.encode(data, 'hex'))
1200346
def handle_message(self, msg):
        
        if msg.msg_id in self.messagesAllowed:
            super(LimitedReporter, self).handle_message(msg)
1335193
def _handle_msg(self, msg):
        """"""
        data = msg['content']['data']
        method = data['method']

        if method == 'update':
            if 'state' in data:
                state = data['state']
                if 'buffer_paths' in data:
                    _put_buffers(state, data['buffer_paths'], msg['buffers'])
                self.set_state(state)

        # Handle a state request.
        elif method == 'request_state':
            self.send_state()

        # Handle a custom msg from the front-end.
        elif method == 'custom':
            if 'content' in data:
                self._handle_custom_msg(data['content'], msg['buffers'])

        # Catch remainder.
        else:
            self.log.error('Unknown front-end to back-end widget msg with method "%s"' % method)
309587
public void afterResponse(Event event) {
		ChaincodeMessage message = messageHelper(event);
		try {
			sendChannel(message);
			logger.debug(String.format("[%s]Received %s, communicated (state:%s)",
					shortID(message), message.getType(), fsm.current()));
		} catch (Exception e) {
			logger.error(String.format("[%s]error sending %s (state:%s): %s", shortID(message),
					message.getType(), fsm.current(), e));
		}
	}
1111553
def _receive_callback(self, raw_message):
        """"""
        message = self.backend.message_to_python(raw_message)
        if self.auto_ack and not message.acknowledged:
            message.ack()
        try:
            decoded = message.decode()
        except Exception, exc:
            if not self.on_decode_error:
                raise
            self.on_decode_error(message, exc)
        else:
            self.receive(decoded, 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
678110
def handle(self, message):
        '''
        
        '''

        logger.debug(message)
        if Utilities.isNotEmpty(message['metadata']['opts']):
            target = message['metadata']['opts']['target']

            for split_line in Utilities.tokenize(message['text']):
                for truncated_line in Utilities.truncate(split_line):
                    self.botThread.connection.privmsg(target, truncated_line)
                    # Delay to prevent floods
                    time.sleep(0.25)
47471
def data_received(self, data):
        """"""
        # A message might be split over several reads, so we store a buffer and
        # try to decode messages from that buffer
        self._buffer += data
        log_binary(_LOGGER, '<< Receive', Data=data)

        while self._buffer:
            # The variant tells us how much data must follow
            length, raw = read_variant(self._buffer)
            if len(raw) < length:
                _LOGGER.debug(
                    'Require %d bytes but only %d in buffer', length, len(raw))
                break

            data = raw[:length]  # Incoming message (might be encrypted)
            self._buffer = raw[length:]  # Buffer, might contain more messages

            try:
                self._handle_message(data)
            except Exception:  # pylint: disable=broad-except
                _LOGGER.error('Failed to handle message')
709227
def handle_message(self, client_conn, msg):
        
        # log messages received so that no one else has to
        self._logger.debug('received: {0!s}'.format(msg))

        if msg.mtype == msg.REQUEST:
            return self.handle_request(client_conn, msg)
        elif msg.mtype == msg.INFORM:
            return self.handle_inform(client_conn, msg)
        elif msg.mtype == msg.REPLY:
            return self.handle_reply(client_conn, msg)
        else:
            reason = "Unexpected message type received by server ['%s']." \
                     % (msg,)
            client_conn.inform(self.create_log_inform("error", reason, "root"))
1035156
def received_message(self, m):
        """"""

        # TODO: No support for binary messages
        m = str(m)
        logger.debug("Incoming upstream WS: %s", m)
        uwsgi.websocket_send(m)
        logger.debug("Send ok")
294647
function receive(message) {
        message = JSON.parse(message);
        _debug("receive: parsed message", message);

        if (!receivers[message.type])
            return; // ignore bad message types
        if (!hasLocal(message.to)) {
            if (typeof options.onmessagelost === "function") {
                options.onmessagelost(message);
            }
            // ignore messages to non-existant or forgotten promises
            return;
        }
        receivers[message.type](message);
    }
13364
def RECEIVE_MESSAGE(op):
    '''
        
    '''
    msg = op.message
    
    text = msg.text
    msg_id = msg.id
    receiver = msg.to
    sender = msg._from
    
    try:
        # Check content only text message
        if msg.contentType == 0:
            # Check only group chat
            if msg.toType == 2:
                # Chat checked request
                line.sendChatChecked(receiver, msg_id)
                # Get sender contact
                contact = line.getContact(sender)
                # Command list
                if text.lower() == 'hi':
                    line.log('[%s] %s' % (contact.displayName, text))
                    line.sendMessage(receiver, 'Hi too! How are you?')
                elif text.lower() == '/author':
                    line.log('[%s] %s' % (contact.displayName, text))
                    line.sendMessage(receiver, 'My author is linepy')
    except Exception as e:
        line.log("[RECEIVE_MESSAGE] ERROR : " + str(e))
372755
private void handleIncomingResponseMessage(SerialMessage incomingMessage) {
		logger.debug("Message type = RESPONSE");
		switch (incomingMessage.getMessageClass()) {
			case GetVersion:
				handleGetVersionResponse(incomingMessage);
				if (incomingMessage.getMessageClass() == this.lastSentMessage.getExpectedReply() && !incomingMessage.isTransActionCanceled()) {
					notifyEventListeners(new ZWaveEvent(ZWaveEventType.TRANSACTION_COMPLETED_EVENT, this.lastSentMessage.getMessageNode(), 1, this.lastSentMessage));
					transactionCompleted.release();
					logger.trace("Released. Transaction completed permit count -> {}", transactionCompleted.availablePermits());
				}
				break;
			case MemoryGetId:
				handleMemoryGetId(incomingMessage);
				if (incomingMessage.getMessageClass() == this.lastSentMessage.getExpectedReply() && !incomingMessage.isTransActionCanceled()) {
					notifyEventListeners(new ZWaveEvent(ZWaveEventType.TRANSACTION_COMPLETED_EVENT, this.lastSentMessage.getMessageNode(), 1, this.lastSentMessage));
					transactionCompleted.release();
					logger.trace("Released. Transaction completed permit count -> {}", transactionCompleted.availablePermits());
				}
				break;
			case SerialApiGetInitData:
				handleSerialApiGetInitDataResponse(incomingMessage);
				if (incomingMessage.getMessageClass() == this.lastSentMessage.getExpectedReply() && !incomingMessage.isTransActionCanceled()) {
					notifyEventListeners(new ZWaveEvent(ZWaveEventType.TRANSACTION_COMPLETED_EVENT, this.lastSentMessage.getMessageNode(), 1, this.lastSentMessage));
					transactionCompleted.release();
					logger.trace("Released. Transaction completed permit count -> {}", transactionCompleted.availablePermits());
				}
				break;
			case IdentifyNode:
				handleIdentifyNodeResponse(incomingMessage);
				if (incomingMessage.getMessageClass() == this.lastSentMessage.getExpectedReply() && !incomingMessage.isTransActionCanceled()) {
					notifyEventListeners(new ZWaveEvent(ZWaveEventType.TRANSACTION_COMPLETED_EVENT, this.lastSentMessage.getMessageNode(), 1, this.lastSentMessage));
					transactionCompleted.release();
					logger.trace("Released. Transaction completed permit count -> {}", transactionCompleted.availablePermits());
				}
				break;
			case RequestNodeInfo:
				handleRequestNodeInfoResponse(incomingMessage);
				break;
			case SerialApiGetCapabilities:
				handleSerialAPIGetCapabilitiesResponse(incomingMessage);
				if (incomingMessage.getMessageClass() == this.lastSentMessage.getExpectedReply() && !incomingMessage.isTransActionCanceled()) {
					notifyEventListeners(new ZWaveEvent(ZWaveEventType.TRANSACTION_COMPLETED_EVENT, this.lastSentMessage.getMessageNode(), 1, this.lastSentMessage));
					transactionCompleted.release();
					logger.trace("Released. Transaction completed permit count -> {}", transactionCompleted.availablePermits());
				}
				break;
			case SendData:
				handleSendDataResponse(incomingMessage);
				break;
			default:
				logger.warn(String.format("TODO: Implement processing of Response Message = %s (0x%02X)",
						incomingMessage.getMessageClass().getLabel(),
						incomingMessage.getMessageClass().getKey()));
				break;				
		}
	}
776168
async def _process_message(self, message):
        
        self._pending_ack.add(message.msg_id)
        handler = self._handlers.get(message.obj.CONSTRUCTOR_ID,
                                     self._handle_update)
        await handler(message)
78163
def recv_msg(body,
             message):
    

    log.info(("callback received msg "))

    agg.handle_msg(
        body=body,
        org_message=message)
1269708
def on_message_received(self, msg):
        
        if self.is_stopped:
            raise RuntimeError("reader has already been stopped")
        else:
            self.buffer.put(msg)