public void HandleMessage(IMessageData messageData)
 {
     if (messageData.GetType() == typeof(HandshakeChallengeMsgData))
     {
         HandleChallengeReceivedMessage((HandshakeChallengeMsgData)messageData);
     }
     else if (messageData.GetType() == typeof(HandshakeReplyMsgData))
     {
         HandleHandshakeReplyReceivedMessage((HandshakeReplyMsgData)messageData);
     }
 }
Exemplo n.º 2
0
 private void HandleMessage(IMessageData msgData)
 {
     try
     {
         MessageHandler.HandleMessage(msgData);
     }
     catch (Exception e)
     {
         LunaLog.LogError($"[LMP]: Error handling Message type {msgData.GetType()}, exception: {e}");
         NetworkConnection.Disconnect($"Error handling {msgData.GetType()} Message");
     }
 }
Exemplo n.º 3
0
        public override void publishStructureMessage(string action, IMessageData data)
        {
            var message = new Message()
            {
                Action = action,
                MessageDataClassName = data.GetType().Name,
                MessageData          = data
            };
            var body = Encoding.UTF8.GetBytes(serializeMessage(message));

            channel.BasicPublish(exchange: this.exchangeFanout,
                                 routingKey: this.queue,
                                 basicProperties: null,
                                 body: body);
        }