Exemplo n.º 1
0
        /// <summary>
        /// Routes all messages that arrive from the hub, according to their Context
        /// </summary>
        /// <param name="message">arrived message</param>
        private void Decode(NodeMessage message)
        {
            Logger.Append(Severity.TRIVIA, "Received raw message '" + message.ToJson() + "'");
            switch (message.Context)
            {
            case MessageContext.Generic:
                HandleGenericRequest(message);
                break;

            case MessageContext.Authentication:
                HandleAuthMessage(message);
                break;

            case MessageContext.Task:
                HandleTaskMessage(message);
                break;
            }
        }
Exemplo n.º 2
0
 private static void HubWrite(NodeMessage message)
 {
     HubWrite(message.ToJson <NodeMessage>());
 }