예제 #1
0
        protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state)
        {
            ServiceBusChannelListener <TChannel> .OpenAsyncResult openAsyncResult = new ServiceBusChannelListener <TChannel> .OpenAsyncResult(this, timeout, callback, state);

            openAsyncResult.Start();
            return(openAsyncResult);
        }
예제 #2
0
 public CreateAndOpenMessageReceiverAsyncResult(ServiceBusInputChannel inputChannel, TimeSpan timeout, AsyncCallback callback, object state) : base(timeout, callback, state)
 {
     this.inputChannel     = inputChannel;
     this.channelListener  = inputChannel.ChannelListener;
     this.messagingFactory = this.channelListener.MessagingFactory;
     this.entityName       = this.channelListener.MessagingAddress.EntityName;
     this.receiveMode      = this.channelListener.ReceiveMode;
     this.prefetchCount    = this.channelListener.PrefetchCount;
 }
예제 #3
0
 public OpenAsyncResult(ServiceBusChannelListener <TChannel> channelListener, TimeSpan timeout, AsyncCallback callback, object state) : base(timeout, callback, state)
 {
     this.channelListener = channelListener;
     this.factorySettings = this.channelListener.MessagingFactorySettings;
     if (!this.factorySettings.NetMessagingTransportSettings.GatewayMode)
     {
         this.messagingFactoryAddress = this.channelListener.MessagingAddress.NamingAuthority;
         return;
     }
     this.messagingFactoryAddress = this.channelListener.MessagingAddress.ResourceAddress;
 }
예제 #4
0
            protected override IEnumerator <IteratorAsyncResult <ServiceBusChannelListener <TChannel> .OpenAsyncResult> .AsyncStep> GetAsyncSteps()
            {
                ServiceBusChannelListener <TChannel> .OpenAsyncResult openAsyncResult = this;
                IteratorAsyncResult <ServiceBusChannelListener <TChannel> .OpenAsyncResult> .BeginCall beginCall        = (ServiceBusChannelListener <TChannel> .OpenAsyncResult thisPtr, TimeSpan t, AsyncCallback c, object s) => Microsoft.ServiceBus.Messaging.MessagingFactory.BeginCreate(thisPtr.messagingFactoryAddress, thisPtr.factorySettings, t, c, s);
                IteratorAsyncResult <ServiceBusChannelListener <TChannel> .OpenAsyncResult> .EndCall   messagingFactory = (ServiceBusChannelListener <TChannel> .OpenAsyncResult thisPtr, IAsyncResult a) => thisPtr.channelListener.MessagingFactory = Microsoft.ServiceBus.Messaging.MessagingFactory.EndCreate(a);
                yield return(openAsyncResult.CallAsync(beginCall, messagingFactory, (ServiceBusChannelListener <TChannel> .OpenAsyncResult thisPtr, TimeSpan t) => thisPtr.channelListener.MessagingFactory = Microsoft.ServiceBus.Messaging.MessagingFactory.Create(thisPtr.messagingFactoryAddress, thisPtr.factorySettings, t), IteratorAsyncResult <TIteratorAsyncResult> .ExceptionPolicy.Continue));

                if (this.ContineAfterMessagingException(base.LastAsyncStepException))
                {
                    this.channelListener.MessagingFactory.SafeAddFaulted(new EventHandler(this.channelListener.OnMessagingFactoryFaulted));
                    ServiceBusChannelListener <TChannel> .OpenAsyncResult openAsyncResult1 = this;
                    IteratorAsyncResult <ServiceBusChannelListener <TChannel> .OpenAsyncResult> .BeginCall beginCall1 = (ServiceBusChannelListener <TChannel> .OpenAsyncResult thisPtr, TimeSpan t, AsyncCallback c, object s) => thisPtr.channelListener.MessagingFactory.BeginOpen(t, c, s);
                    IteratorAsyncResult <ServiceBusChannelListener <TChannel> .OpenAsyncResult> .EndCall   endCall    = (ServiceBusChannelListener <TChannel> .OpenAsyncResult thisPtr, IAsyncResult a) => thisPtr.channelListener.MessagingFactory.EndOpen(a);
                    yield return(openAsyncResult1.CallAsync(beginCall1, endCall, (ServiceBusChannelListener <TChannel> .OpenAsyncResult thisPtr, TimeSpan t) => thisPtr.channelListener.MessagingFactory.Open(t), IteratorAsyncResult <TIteratorAsyncResult> .ExceptionPolicy.Continue));

                    this.ContineAfterMessagingException(base.LastAsyncStepException);
                }
            }
예제 #5
0
 public ServiceBusInputSessionChannel(MessageSession messageSession, ServiceBusChannelListener <IInputSessionChannel> parent) : base(parent)
 {
     this.Session            = new ServiceBusInputSessionChannel.InputSession(messageSession.SessionId);
     base.MessageReceiver    = messageSession;
     this.sessionIdleTimeout = parent.TransportBindingElement.SessionIdleTimeout;
 }
예제 #6
0
 public ServiceBusInputChannel(ServiceBusChannelListener <IInputChannel> parent) : base(parent)
 {
 }
예제 #7
0
 public ServiceBusInputChannelBase(ServiceBusChannelListener <TChannel> channelListener) : base(channelListener)
 {
     this.ChannelListener = channelListener;
     this.LocalAddress    = new EndpointAddress(channelListener.Uri, new AddressHeader[0]);
 }