Deals with messages coming from the core over our secure connection
@param data
972741
function (data) {
        var msg = messages.unwrap(data);
        if (!msg) {
            logger.error("routeMessage got a NULL coap message ", { coreID: this.getHexCoreID() });
            return;
        }

        this._lastMessageTime = new Date();

        //should be adequate
        var msgCode = msg.getCode();
        if ((msgCode > Message.Code.EMPTY) && (msgCode <= Message.Code.DELETE)) {
            //probably a request
            msg._type = messages.getRequestType(msg);
        }

        if (!msg._type) {
            msg._type = this.getResponseType(msg.getTokenString());
        }

        //console.log("core got message of type " + msg._type + " with token " + msg.getTokenString() + " " + messages.getRequestType(msg));

        if (msg.isAcknowledgement()) {
            if (!msg._type) {
                //no type, can't route it.
                msg._type = 'PingAck';
            }
            this.emit(('msg_' + msg._type).toLowerCase(), msg);
            return;
        }


        var nextPeerCounter = ++this.recvCounter;
        if (nextPeerCounter > 65535) {
            //TODO: clean me up! (I need settings, and maybe belong elsewhere)
            this.recvCounter = nextPeerCounter = 0;
        }

        if (msg.isEmpty() && msg.isConfirmable()) {
            this._lastCorePing = new Date();
            //var delta = (this._lastCorePing - this._connStartTime) / 1000.0;
            //logger.log("core ping @ ", delta, " seconds ", { coreID: this.getHexCoreID() });
            this.sendReply("PingAck", msg.getId());
            return;
        }

        if (!msg || (msg.getId() != nextPeerCounter)) {
            logger.log("got counter ", msg.getId(), " expecting ", nextPeerCounter, { coreID: this.getHexCoreID() });

            if (msg._type == "Ignored") {
                //don't ignore an ignore...
                this.disconnect("Got an Ignore");
                return;
            }

            //this.sendMessage("Ignored", null, {}, null, null);
            this.disconnect("Bad Counter");
            return;
        }

        this.emit(('msg_' + msg._type).toLowerCase(), msg);
    }
1166967
function handleIncomingMessage(data) {
		var message;
		reader.parse(data, initPending);
		initPending = false;
		while (!reader.isEmpty()) {
			message = reader.pop();
			// console.log("IN MESSAGE: " + inspect(message));
			handlers[message.verb](message);
		}
	}
831293
function(data) {
      if (!data) {
        data = this.getContent();
      }
      return this.encoder.encryptAes(JSON.stringify(data), this.getSecret());
    }
660069
@Override
    public void onConnected() {
        HMSAgentLog.d("connect success");
        timeoutHandler.removeMessages(APICLIENT_TIMEOUT_HANDLE_MSG);
        onConnectEnd(ConnectionResult.SUCCESS);
    }
134270
protected void processData(Collection<RI> data) {
        // Check data against all rules
        for (Rule<Collection<RI>, RO> rule : rules) {
            processResult(rule.validate(data));
        }
    }
245315
private byte[] cipherData(final byte[] data) {
        byte[] result = null;
        try {
            final byte[] buffer = new byte[this.paddedBufferedBlockCipher.getOutputSize(data.length)];

            final int processedBytes = this.paddedBufferedBlockCipher.processBytes(data, 0, data.length, buffer, 0);
            final int finalBytes = this.paddedBufferedBlockCipher.doFinal(buffer, processedBytes);

            result = new byte[processedBytes + finalBytes];
            System.arraycopy(buffer, 0, result, 0, result.length);
        } catch (final CryptoException e) {
            LOG.error("Failed to encrypt/decrypt data array", e);
        }

        return result;
    }
712434
public final void messageUnlocked(AIStreamKey key)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.entry(this, tc, "messageUnlocked", key);
    synchronized (this)
    {
      countOfUnlockedMessages++;
      
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
          SibTr.debug(tc, "readAhead change: countOfUnlockedMessages++ " + countOfUnlockedMessages);
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.exit(this, tc, "messageUnlocked");
  }
298523
@Override
	public void setData(final Object data) {
		if (isRichTextArea() && data instanceof String) {
			super.setData(sanitizeInputText((String) data));
		} else {
			super.setData(data);
		}
	}
980953
public void setThisData(byte[] data)
    {
        try
        {
            pen.setData(data);
        }
        catch ( Exception e )
        {
            ThreadUtils.checkInterrupted(e);
            Throwables.propagate(e);
        }
    }
320909
public void handleData(String data) {
		state = data.equals("1");
		sendEvent(new CheckEvent(this.user, getPayload(), state));
		if (checkHandler != null)
			checkHandler.checked(state);
	}
667343
protected final void safePostMessage (final DownstreamMessage msg)
    {
        _pcmgr._omgr.postRunnable(new Runnable() {
            public void run () {
                postMessage(msg);
            }
        });
    }
916383
@Override
	public void setData(final byte[] data, final int offset)
	{
		if (offset < 0 || offset > data.length)
			throw new KNXIllegalArgumentException("illegal offset " + offset);
		toDPT(data, offset);
	}
79596
@Handler(channels = EncryptedChannel.class)
    public void onConnected(Connected event, IOSubchannel encryptedChannel) {
        new PlainChannel(event, encryptedChannel);
    }
1308950
function (data) {
        data = data || '';
        this._sendAndClose(protocol.PACKET_TYPES.WORK_COMPLETE, [this.handle, data.toString()]);
    }
965600
@Override
    public void onMessageReceived(String from, Bundle data) {
        EasyGcm.Logger.d("Received message from: " + from);

        EasyGcm.getInstance().getGcmListener(getApplication()).onMessage(from, data);

    }
449109
private void handleMemoryGetId(SerialMessage incomingMessage) {
		this.homeId = ((incomingMessage.getMessagePayloadByte(0)) << 24) | 
				((incomingMessage.getMessagePayloadByte(1)) << 16) | 
				((incomingMessage.getMessagePayloadByte(2)) << 8) | 
				(incomingMessage.getMessagePayloadByte(3));
		this.ownNodeId = incomingMessage.getMessagePayloadByte(4);
		logger.debug(String.format("Got MessageMemoryGetId response. Home id = 0x%08X, Controller Node id = %d", this.homeId, this.ownNodeId));
	}
632373
public function sendData($data)
    {
        if ($this->isConnected()) {
            if (socket_write($this->socket, $data, strlen($data)) === false) {
                $this->eventManager()->fire('onClose',
                   [
                        $this->phoneNumber,
                        'Connection closed!',
                    ]
              );
            }
        }
    }