Exemplo n.º 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();
 }
Exemplo n.º 2
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));
 }
Exemplo n.º 3
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);
 }
Exemplo n.º 4
0
 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));
 }
Exemplo n.º 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);
 }
Exemplo n.º 6
0
 public bool Start()
 {
     this.reader = new AsyncIO.FrameBufferReader(this, this.transport);
     this.writer = new AsyncIO.AsyncBufferWriter(this.transport);
     if (this.isInitiator)
     {
         this.state = SaslNegotiator.SaslState.WaitingForServerMechanisms;
         MessagingClientEtwProvider.TraceClient <SaslNegotiator>((SaslNegotiator source) => {
         }, this);
         this.ReadFrame();
     }
     else
     {
         this.SendServerMechanisms();
     }
     return(false);
 }
Exemplo n.º 7
0
        public bool Start()
        {
            this.reader = new AsyncIO.FrameBufferReader(this, transport, this.provider.MaxFrameSize);
            this.writer = new AsyncIO.AsyncBufferWriter(transport);

            if (!this.isInitiator)
            {
                this.SendServerMechanisms();
            }
            else
            {
                this.state = SaslState.WaitingForServerMechanisms;
                AmqpTrace.Provider.AmqpLogOperationVerbose(this, TraceOperation.Execute, "WaitingForServerMechanisms");
                this.ReadFrame();
            }

            return(false);
        }
Exemplo n.º 8
0
        public bool Start()
        {
            this.reader = new AsyncIO.FrameBufferReader(transport);
            this.writer = new AsyncIO.AsyncBufferWriter(transport);

            if (!this.transport.IsInitiator)
            {
                this.SendServerMechanisms();
            }
            else
            {
                Utils.Trace(TraceLevel.Info, "{0}: waiting for server mechanisms", this);
                this.state = SaslState.WaitingForServerMechanisms;
                this.ReadFrame();
            }

            return false;
        }
Exemplo n.º 9
0
        public bool Start()
        {
            this.reader = new AsyncIO.FrameBufferReader(transport);
            this.writer = new AsyncIO.AsyncBufferWriter(transport);

            if (!this.transport.IsInitiator)
            {
                this.SendServerMechanisms();
            }
            else
            {
                Utils.Trace(TraceLevel.Info, "{0}: waiting for server mechanisms", this);
                this.state = SaslState.WaitingForServerMechanisms;
                this.ReadFrame();
            }

            return(false);
        }
Exemplo n.º 10
0
        public bool Start()
        {
            this.reader = new AsyncIO.FrameBufferReader(this, transport, this.provider.MaxFrameSize);
            this.writer = new AsyncIO.AsyncBufferWriter(transport);

            if (!this.isInitiator)
            {
                this.SendServerMechanisms();
            }
            else
            {
                this.state = SaslState.WaitingForServerMechanisms;
                AmqpTrace.Provider.AmqpLogOperationVerbose(this, TraceOperation.Execute, "WaitingForServerMechanisms");
                this.ReadFrame();
            }

            return false;
        }
Exemplo n.º 11
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);
        }
Exemplo n.º 12
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;
            }

            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);
        }
Exemplo n.º 13
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);
            }
        }
Exemplo n.º 14
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);
            }
        }
Exemplo n.º 15
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);
        }