public void SendCommitted(EndpointAddress sendTo)
 {
     if (sendTo != null)
     {
         CompletionParticipantProxy proxy = this.state.TryCreateCompletionParticipantProxy(sendTo);
         if (proxy != null)
         {
             try
             {
                 if (DebugTrace.Info)
                 {
                     DebugTrace.Trace(TraceLevel.Info, "Sending Committed to unrecognized completion participant at {0}", Ports.TryGetAddress(proxy));
                 }
                 IAsyncResult ar = proxy.BeginSendCommitted(this.politeSendComplete, proxy);
                 if (ar.CompletedSynchronously)
                 {
                     this.OnSendComplete(ar, null, proxy);
                 }
             }
             finally
             {
                 proxy.Release();
             }
         }
     }
 }
示例#2
0
 private void TrySendFault(DatagramProxy proxy, UniqueId messageID, Fault fault)
 {
     if (proxy == null)
     {
         if (DebugTrace.Warning)
         {
             DebugTrace.Trace(TraceLevel.Warning, "Could not create a proxy to send {0} fault", fault.Code.Name);
         }
     }
     else
     {
         this.state.Perf.FaultsSentCountPerInterval.Increment();
         if (DebugTrace.Info)
         {
             DebugTrace.Trace(TraceLevel.Info, "Sending {0} fault to {1}", fault.Code.Name, Ports.TryGetAddress(proxy));
         }
         IAsyncResult ar = proxy.BeginSendFault(messageID, fault, this.sendFaultComplete, proxy);
         if (ar.CompletedSynchronously)
         {
             this.OnSendFaultComplete(ar, proxy);
         }
     }
 }
示例#3
0
        public void SendVolatileReadOnly(VolatileCoordinatorEnlistment coordinator)
        {
            if (DebugTrace.Info)
            {
                DebugTrace.TxTrace(TraceLevel.Info, coordinator.EnlistmentId, "Sending ReadOnly to volatile coordinator at {0}", Ports.TryGetAddress(coordinator.CoordinatorProxy));
            }
            IAsyncResult ar = coordinator.CoordinatorProxy.BeginSendReadOnly(this.volatileSendComplete, coordinator);

            if (ar.CompletedSynchronously)
            {
                this.OnVolatileSendComplete(ar, coordinator);
            }
        }
        public void SendCommitted(CompletionEnlistment completion)
        {
            if (DebugTrace.Info)
            {
                DebugTrace.TxTrace(TraceLevel.Info, completion.EnlistmentId, "Sending Committed to completion participant at {0}", Ports.TryGetAddress(completion.ParticipantProxy));
            }
            IAsyncResult ar = completion.ParticipantProxy.BeginSendCommitted(this.sendComplete, completion);

            if (ar.CompletedSynchronously)
            {
                this.OnSendComplete(ar, completion, completion.ParticipantProxy);
            }
        }
示例#5
0
        public void SendRecoverMessage(CoordinatorEnlistment coordinator)
        {
            if (DebugTrace.Info)
            {
                DebugTrace.TxTrace(TraceLevel.Info, coordinator.EnlistmentId, "Sending Replay to durable coordinator at {0}", Ports.TryGetAddress(coordinator.CoordinatorProxy));
            }
            IAsyncResult ar = coordinator.CoordinatorProxy.BeginSendRecoverMessage(this.durableSendComplete, coordinator);

            if (ar.CompletedSynchronously)
            {
                this.OnDurableSendComplete(ar, coordinator);
            }
        }
示例#6
0
 public void SendReadOnly(EndpointAddress sendTo)
 {
     if (sendTo != null)
     {
         TwoPhaseCommitCoordinatorProxy proxy = this.state.TryCreateTwoPhaseCommitCoordinatorProxy(sendTo);
         if (proxy != null)
         {
             try
             {
                 if (DebugTrace.Info)
                 {
                     DebugTrace.Trace(TraceLevel.Info, "Sending ReadOnly to unrecognized participant at {0}", Ports.TryGetAddress(proxy));
                 }
                 IAsyncResult ar = proxy.BeginSendReadOnly(this.politeSendComplete, proxy);
                 if (ar.CompletedSynchronously)
                 {
                     this.OnPoliteSendComplete(ar, proxy);
                 }
             }
             finally
             {
                 proxy.Release();
             }
         }
     }
 }
 public void SendRollback(EndpointAddress sendTo)
 {
     if (sendTo != null)
     {
         TwoPhaseCommitParticipantProxy proxy = this.state.TryCreateTwoPhaseCommitParticipantProxy(sendTo);
         if (proxy != null)
         {
             try
             {
                 if (DebugTrace.Info)
                 {
                     DebugTrace.Trace(TraceLevel.Info, "Sending Rollback to unrecognized participant at {0}", Ports.TryGetAddress(proxy));
                 }
                 proxy.From = this.CreateForgottenSource();
                 IAsyncResult ar = proxy.BeginSendRollback(this.politeSendComplete, proxy);
                 if (ar.CompletedSynchronously)
                 {
                     this.OnPoliteSendComplete(ar, proxy);
                 }
             }
             finally
             {
                 proxy.Release();
             }
         }
     }
 }
        public void SendRollback(ParticipantEnlistment participant)
        {
            if (DebugTrace.Info)
            {
                DebugTrace.TxTrace(TraceLevel.Info, participant.EnlistmentId, "Sending Rollback to {0} participant at {1}", participant.ControlProtocol, Ports.TryGetAddress(participant.ParticipantProxy));
            }
            IAsyncResult ar = participant.ParticipantProxy.BeginSendRollback(this.sendComplete, participant);

            if (ar.CompletedSynchronously)
            {
                this.OnSendComplete(ar, participant);
            }
        }
示例#9
0
        private void SendRegister(CoordinatorEnlistment coordinator, ControlProtocol protocol, EndpointAddress protocolService, AsyncCallback callback, object callbackState)
        {
            Register register = new Register(this.state.ProtocolVersion)
            {
                Protocol = protocol,
                Loopback = this.state.ProcessId,
                ParticipantProtocolService = protocolService,
                SupportingToken            = coordinator.SuperiorIssuedToken
            };

            if (DebugTrace.Info)
            {
                DebugTrace.TxTrace(TraceLevel.Info, coordinator.EnlistmentId, "Sending Register for {0} to {1}", protocol, Ports.TryGetAddress(coordinator.RegistrationProxy));
            }
            IAsyncResult ar = coordinator.RegistrationProxy.BeginSendRegister(ref register, callback, callbackState);

            if (ar.CompletedSynchronously)
            {
                this.OnSendRegisterComplete(coordinator, protocol, ar);
            }
        }