示例#1
0
 void HandleTransportOpened(IAsyncResult result)
 {
     this.args.Transport.EndOpen(result);
     this.bufferReader = new AsyncIO.AsyncBufferReader(this.args.Transport);
     this.bufferWriter = new AsyncIO.AsyncBufferWriter(this.args.Transport);
     this.ReadProtocolHeader();
 }
示例#2
0
 TransportHandler(AmqpTransportListener parent, TransportAsyncCallbackArgs args)
 {
     this.parent         = parent;
     this.args           = args;
     this.args.UserToken = this;
     this.buffer         = new byte[AmqpConstants.ProtocolHeaderSize];
     this.bufferReader   = new AsyncIO.AsyncBufferReader(args.Transport);
     this.bufferWriter   = new AsyncIO.AsyncBufferWriter(args.Transport);
     this.timeoutHelper  = new TimeoutHelper(AmqpConstants.DefaultTimeout);
 }
示例#3
0
 private TransportHandler(AmqpTransportListener parent, TransportAsyncCallbackArgs args)
 {
     this.parent         = parent;
     this.args           = args;
     this.args.UserToken = this;
     this.buffer         = new byte[8];
     this.bufferReader   = new AsyncIO.AsyncBufferReader(args.Transport);
     this.bufferWriter   = new AsyncIO.AsyncBufferWriter(args.Transport);
     this.timeoutHelper  = new TimeoutHelper(TimeSpan.FromSeconds(60));
 }
 TransportHandler(AmqpTransportListener parent, TransportAsyncCallbackArgs args)
 {
     this.parent = parent;
     this.args = args;
     this.buffer = new byte[ProtocolHeader.Size];
     this.bufferReader = new AsyncIO.AsyncBufferReader(args.Transport);
     this.bufferWriter = new AsyncIO.AsyncBufferWriter(args.Transport);
     this.readCompleteCallback = this.OnReadHeaderComplete;
     this.writeCompleteCallback = this.OnWriteHeaderComplete;
     this.timeoutHelper = new TimeoutHelper(TimeSpan.FromSeconds(AmqpConstants.DefaultTimeout));
 }
示例#5
0
 private void OnConnectComplete(TransportAsyncCallbackArgs args)
 {
     if (args.Exception != null)
     {
         this.Complete(args);
         return;
     }
     if (this.settings.TransportProviders[this.providerIndex].ProtocolId == ProtocolId.Amqp)
     {
         this.Complete(args);
         return;
     }
     this.writer = new AsyncIO.AsyncBufferWriter(args.Transport);
     this.reader = new AsyncIO.AsyncBufferReader(args.Transport);
     this.WriteSecurityHeader(args);
 }
示例#6
0
        private void HandleTransportOpened(IAsyncResult result)
        {
            TransportAsyncCallbackArgs asyncState = (TransportAsyncCallbackArgs)result.AsyncState;

            asyncState.Transport.EndOpen(result);
            AmqpTransportInitiator amqpTransportInitiator = this;

            amqpTransportInitiator.providerIndex = amqpTransportInitiator.providerIndex + 1;
            if (this.providerIndex == this.settings.TransportProviders.Count || this.settings.TransportProviders[this.providerIndex].ProtocolId == ProtocolId.Amqp)
            {
                this.writer        = null;
                this.reader        = null;
                this.providerIndex = 0;
                this.Complete(asyncState);
                return;
            }
            this.writer = new AsyncIO.AsyncBufferWriter(asyncState.Transport);
            this.reader = new AsyncIO.AsyncBufferReader(asyncState.Transport);
            this.WriteSecurityHeader(asyncState);
        }
        void OnConnectComplete(TransportAsyncCallbackArgs args)
        {
            if (args.Exception != null)
            {
                this.Complete(args);
                return;
            }

            TransportProvider provider = this.settings.TransportProviders[this.providerIndex];

            if (provider.ProtocolId == ProtocolId.Amqp)
            {
                this.Complete(args);
                return;
            }

            Utils.Trace(TraceLevel.Info, "{0}: Connected. Start security negotiation...", this);
            this.writer = new AsyncIO.AsyncBufferWriter(args.Transport);
            this.reader = new AsyncIO.AsyncBufferReader(args.Transport);
            this.WriteSecurityHeader(args);
        }
示例#8
0
        void HandleTransportOpened(IAsyncResult result)
        {
            TransportAsyncCallbackArgs args = (TransportAsyncCallbackArgs)result.AsyncState;

            args.Transport.EndOpen(result);

            ++this.providerIndex;
            if (this.providerIndex == this.settings.TransportProviders.Count ||
                this.settings.TransportProviders[this.providerIndex].ProtocolId == ProtocolId.Amqp)
            {
                this.writer        = null;
                this.reader        = null;
                this.providerIndex = 0;
                this.Complete(args);
            }
            else
            {
                this.writer = new AsyncIO.AsyncBufferWriter(args.Transport);
                this.reader = new AsyncIO.AsyncBufferReader(args.Transport);
                this.WriteSecurityHeader(args);
            }
        }
        void HandleTransportOpened(IAsyncResult result)
        {
            TransportAsyncCallbackArgs args = (TransportAsyncCallbackArgs)result.AsyncState;
            args.Transport.EndOpen(result);

            ++this.providerIndex;
            if (this.providerIndex == this.settings.TransportProviders.Count ||
                this.settings.TransportProviders[this.providerIndex].ProtocolId == ProtocolId.Amqp)
            {
                this.writer = null;
                this.reader = null;
                this.providerIndex = 0;
                this.Complete(args);
            }
            else
            {
                this.writer = new AsyncIO.AsyncBufferWriter(args.Transport);
                this.reader = new AsyncIO.AsyncBufferReader(args.Transport);
                this.WriteSecurityHeader(args);
            }
        }
示例#10
0
        void OnConnectComplete(TransportAsyncCallbackArgs args)
        {
            if (args.Exception != null)
            {
                this.Complete(args);
                return;
            }

            TransportProvider provider = this.settings.TransportProviders[this.providerIndex];
            if (provider.ProtocolId == ProtocolId.Amqp)
            {
                this.Complete(args);
                return;
            }

            this.writer = new AsyncIO.AsyncBufferWriter(args.Transport);
            this.reader = new AsyncIO.AsyncBufferReader(args.Transport);
            this.WriteSecurityHeader(args);
        }