public void HandleMessage(IMessageData messageData)
 {
     if (messageData.GetType() == typeof(HandshakeChallengeMsgData))
     {
         HandleChallengeReceivedMessage((HandshakeChallengeMsgData)messageData);
     }
     else if (messageData.GetType() == typeof(HandshakeReplyMsgData))
     {
         HandleHandshakeReplyReceivedMessage((HandshakeReplyMsgData)messageData);
     }
 }
示例#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");
     }
 }
示例#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);
        }