Beispiel #1
0
        public void OnMessageReceived(string json)
        {
            //AmqpMessageHandler.PrintJson(json);
            JsToCSharpMessage msg = JsToCSharpMessage.ConvertToObject(json);

            Debug.Log("Received unrecognized message " + msg.type + " from the server: " + msg.body);
        }
Beispiel #2
0
        public void OnMessageReceived(AmqpExchangeSubscription subscription, IAmqpReceivedMessage message)
        {
            var origMsgText = Encoding.UTF8.GetString(message.Body);
            var origMsg     = JsToCSharpMessage.ConvertToObject(origMsgText);

            var origMsgEscaped = origMsgText.Replace("\\", "\\\\").Replace("\"", "\\\"");

            OnMessageReceived("{\"type\":\"" + origMsg.type + "\",\"body\":\"" + origMsgEscaped + "\"}");
        }