コード例 #1
0
        static void ReceiveAndProcessRequest(IMessageExchangeStream stream, Func <RequestMessage, ResponseMessage> incomingRequestProcessor)
        {
            var request = stream.Receive <RequestMessage>();

            if (request != null)
            {
                var response = InvokeAndWrapAnyExceptions(request, incomingRequestProcessor);
                stream.Send(response);
            }

            stream.SendNext();
            stream.ExpectProceeed();
        }
コード例 #2
0
 void PrepareExchangeAsClient()
 {
     try
     {
         if (!identified)
         {
             stream.IdentifyAsClient();
             identified = true;
         }
         else
         {
             stream.SendNext();
             stream.ExpectProceeed();
         }
     }
     catch (Exception ex)
     {
         throw new ConnectionInitializationFailedException(ex);
     }
 }
コード例 #3
0
        static void ReceiveAndProcessRequest(IMessageExchangeStream stream, Func<RequestMessage, ResponseMessage> incomingRequestProcessor)
        {
            var request = stream.Receive<RequestMessage>();
            if (request != null)
            {
                var response = InvokeAndWrapAnyExceptions(request, incomingRequestProcessor);
                stream.Send(response);
            }

            stream.SendNext();
            stream.ExpectProceeed();
        }