Esempio n. 1
0
 private void RawMessageReceived(IMessage message)
 {
     try
     {
         var fudge = _fudgeMessageDecoder.GetMessage(message);
         if (fudge.Message.GetNumFields() == 0)
         {
             if (_startSignalReceivedEvent.IsSet)
             {
                 throw new OpenGammaException("Received multiple start signals");
             }
             _startSignalReceivedEvent.Set();
         }
         else
         {
             var body = _fudgeMessageDecoder.DecodeObject(fudge);
             InvokeMessageReceived(body);
         }
     }
     catch (Exception e)
     {
         _startSignalReceivedEvent.Set(); //Make sure we always get started
         InvokeMessageReceived(e);
     }
 }