示例#1
0
 public IMessage SyncProcessMessage(IMessage msg)
 {
     try
     {
         MessageRunner runner = new MessageRunner {
             inputMessage = msg,
             target       = this
         };
         ThreadRunner.RunSafely(runner);
         return(runner.outMessage);
     }
     catch (Exception exception)
     {
         return(new ReturnMessage(exception, (IMethodCallMessage)msg));
     }
 }
示例#2
0
 public IMessageCtrl AsyncProcessMessage(IMessage msg, IMessageSink replySink)
 {
     try
     {
         MessageRunner runner = new MessageRunner {
             inputMessage = msg,
             target       = this
         };
         ThreadRunner.RunSafely(runner);
         IMessage outMessage = runner.outMessage;
         replySink.SyncProcessMessage(outMessage);
         return(new MessageControl());
     }
     catch (Exception exception)
     {
         replySink.SyncProcessMessage(new ReturnMessage(exception, (IMethodCallMessage)msg));
         return(new MessageControl());
     }
 }