public void Open()
{
if (this.closed)
{
throw new ObjectDisposedException(this.GetType().Name);
}
if (this.address.Scheme.Equals(Address.Amqp, StringComparison.OrdinalIgnoreCase))
{
this.listener = new TcpTransportListener(this, this.address.Host, this.address.Port);
}
else if (this.address.Scheme.Equals(Address.Amqps, StringComparison.OrdinalIgnoreCase))
{
this.listener = new TlsTransportListener(this, this.address.Host, this.address.Port, this.GetServiceCertificate());
}
#if NETFX
else if (this.address.Scheme.Equals(WebSocketTransport.WebSockets, StringComparison.OrdinalIgnoreCase))
{
this.listener = new WebSocketTransportListener(this, this.address.Host, address.Port, address.Path, null);
}
else if (this.address.Scheme.Equals(WebSocketTransport.SecureWebSockets, StringComparison.OrdinalIgnoreCase))
{
this.listener = new WebSocketTransportListener(this, this.address.Host, address.Port, address.Path, this.GetServiceCertificate());
}
#endif
else
{
throw new NotSupportedException(this.address.Scheme);
}
if (this.address.User != null)
{
this.SASL.EnablePlainMechanism(this.address.User, this.address.Password);
}
this.listener.Open();
}