Exemplo n.º 1
0
            public CloseOutputSessionAsyncResult(Microsoft.ServiceBus.Channels.FramingDuplexSessionChannel channel, TimeSpan timeout, AsyncCallback callback, object state) : base(callback, state)
            {
                channel.ThrowIfNotOpened();
                channel.ThrowIfFaulted();
                this.timeoutHelper = new TimeoutHelper(timeout);
                this.channel       = channel;
                if (!channel.sendLock.Enter(Microsoft.ServiceBus.Channels.FramingDuplexSessionChannel.CloseOutputSessionAsyncResult.onEnterComplete, this))
                {
                    return;
                }
                bool flag  = false;
                bool flag1 = false;

                try
                {
                    flag  = this.WriteEndBytes();
                    flag1 = true;
                }
                finally
                {
                    if (!flag1)
                    {
                        this.Cleanup(false);
                    }
                }
                if (flag)
                {
                    this.Cleanup(true);
                    base.Complete(true);
                }
            }
Exemplo n.º 2
0
            public TryReceiveAsyncResult(Microsoft.ServiceBus.Channels.FramingDuplexSessionChannel channel, TimeSpan timeout, AsyncCallback callback, object state) : base(callback, state)
            {
                this.channel = channel;
                bool flag = false;

                try
                {
                    IAsyncResult asyncResult = this.channel.BeginReceive(timeout, Microsoft.ServiceBus.Channels.FramingDuplexSessionChannel.TryReceiveAsyncResult.onReceive, this);
                    if (asyncResult.CompletedSynchronously)
                    {
                        this.CompleteReceive(asyncResult);
                        flag = true;
                    }
                }
                catch (TimeoutException timeoutException1)
                {
                    TimeoutException timeoutException = timeoutException1;
                    if (Microsoft.ServiceBus.Diagnostics.DiagnosticUtility.ShouldTraceInformation)
                    {
                        Microsoft.ServiceBus.Diagnostics.DiagnosticUtility.ExceptionUtility.TraceHandledException(timeoutException, TraceEventType.Information);
                    }
                    flag = true;
                }
                if (flag)
                {
                    base.Complete(true);
                }
            }
Exemplo n.º 3
0
            public SendAsyncResult(Microsoft.ServiceBus.Channels.FramingDuplexSessionChannel channel, Message message, TimeSpan timeout, AsyncCallback callback, object state) : base(callback, state)
            {
                this.timeoutHelper = new TimeoutHelper(timeout);
                this.channel       = channel;
                this.message       = message;
                if (!channel.sendLock.Enter(Microsoft.ServiceBus.Channels.FramingDuplexSessionChannel.SendAsyncResult.onEnterComplete, this))
                {
                    return;
                }
                bool flag  = false;
                bool flag1 = false;

                try
                {
                    flag  = this.WriteCore();
                    flag1 = true;
                }
                finally
                {
                    if (!flag1)
                    {
                        this.Cleanup(false);
                    }
                }
                if (flag)
                {
                    this.Cleanup(true);
                    base.Complete(true);
                }
            }
Exemplo n.º 4
0
            public CloseAsyncResult(Microsoft.ServiceBus.Channels.FramingDuplexSessionChannel channel, TimeSpan timeout, AsyncCallback callback, object state) : base(callback, state)
            {
                this.channel       = channel;
                this.timeoutHelper = new TimeoutHelper(timeout);
                IAsyncResult asyncResult = channel.BeginCloseOutputSession(this.timeoutHelper.RemainingTime(), Microsoft.ServiceBus.Channels.FramingDuplexSessionChannel.CloseAsyncResult.onCloseOutputSession, this);

                if (!asyncResult.CompletedSynchronously)
                {
                    return;
                }
                if (!this.HandleCloseOutputSession(asyncResult, true))
                {
                    return;
                }
                base.Complete(true);
            }
Exemplo n.º 5
0
 private ConnectionDuplexSession(Microsoft.ServiceBus.Channels.FramingDuplexSessionChannel channel)
 {
     this.channel = channel;
 }
Exemplo n.º 6
0
 public SecureConnectionDuplexSession(Microsoft.ServiceBus.Channels.FramingDuplexSessionChannel channel) : base(channel)
 {
 }
Exemplo n.º 7
0
 public static Microsoft.ServiceBus.Channels.FramingDuplexSessionChannel.ConnectionDuplexSession CreateSession(Microsoft.ServiceBus.Channels.FramingDuplexSessionChannel channel, StreamUpgradeProvider upgrade)
 {
     if (!(upgrade is StreamSecurityUpgradeProvider))
     {
         return(new Microsoft.ServiceBus.Channels.FramingDuplexSessionChannel.ConnectionDuplexSession(channel));
     }
     return(new Microsoft.ServiceBus.Channels.FramingDuplexSessionChannel.ConnectionDuplexSession.SecureConnectionDuplexSession(channel));
 }