Ejemplo n.º 1
0
        internal async Task ConnectAsync(Address address, SaslProfile saslProfile, Open open, Connection connection)
        {
            if (saslProfile == null)
            {
                if (address.User != null)
                {
                    saslProfile = new SaslPlainProfile(address.User, address.Password);
                }
                else if (this.saslSettings != null && this.saslSettings.Profile != null)
                {
                    saslProfile = this.saslSettings.Profile;
                }
            }

            IAsyncTransport transport = await this.CreateTransportAsync(address, saslProfile, connection.Handler).ConfigureAwait(false);

            connection.Init(this.BufferManager, this.AMQP, transport, open);

            AsyncPump pump = new AsyncPump(this.BufferManager, transport);

            pump.Start(connection);
        }