/// <summary> /// Initializes a container host object with multiple address. /// </summary> /// <param name="addressUriList">The list of listen addresses.</param> /// <param name="certificate">The service certificate for TLS.</param> /// <param name="userInfo">The credentials required by SASL PLAIN authentication. It is of form "user:password".</param> public ContainerHost(IList <Uri> addressUriList, X509Certificate2 certificate, string userInfo) { this.containerId = string.Join("-", this.GetType().Name, Guid.NewGuid().ToString("N")); this.certificate = certificate; this.linkCollection = new LinkCollection(this.containerId); this.onLinkClosed = this.OnLinkClosed; this.messageProcessors = new Dictionary <string, MessageProcessor>(StringComparer.OrdinalIgnoreCase); this.requestProcessors = new Dictionary <string, RequestProcessor>(StringComparer.OrdinalIgnoreCase); this.listeners = new ConnectionListener[addressUriList.Count]; for (int i = 0; i < addressUriList.Count; i++) { this.listeners[i] = new ConnectionListener(addressUriList[i], userInfo, this); this.listeners[i].AMQP.ContainerId = this.containerId; } }
/// <summary> /// Initializes a container host object with multiple address. /// </summary> /// <param name="addressList">The list of listen addresses.</param> /// <remarks> /// Transport and protocol settings (TCP, SSL, SASL and AMQP) can be /// set on the listeners of the host after it is created. /// </remarks> public ContainerHost(IList <string> addressList) { this.containerId = string.Join("-", this.GetType().Name, Guid.NewGuid().ToString("N")); this.customTransports = new Dictionary <string, TransportProvider>(StringComparer.OrdinalIgnoreCase); this.linkCollection = new LinkCollection(this.containerId); this.onLinkClosed = this.OnLinkClosed; this.messageProcessors = new Dictionary <string, MessageProcessor>(StringComparer.OrdinalIgnoreCase); this.requestProcessors = new Dictionary <string, RequestProcessor>(StringComparer.OrdinalIgnoreCase); this.messageSources = new Dictionary <string, MessageSource>(StringComparer.OrdinalIgnoreCase); this.listeners = new ConnectionListener[addressList.Count]; for (int i = 0; i < addressList.Count; i++) { this.listeners[i] = new ConnectionListener(addressList[i], this); this.listeners[i].AMQP.ContainerId = this.containerId; } }
/// <summary> /// Initializes a container host object with multiple addresses. /// <param name="addressList">The list of listen addresses.</param> /// </summary> public ContainerHost(IList <Address> addressList) { this.containerId = Connection.MakeAmqpContainerId(); this.customTransports = new Dictionary <string, TransportProvider>(StringComparer.OrdinalIgnoreCase); this.linkCollection = new LinkCollection(this.containerId); this.onLinkClosed = this.OnLinkClosed; this.messageProcessors = new Dictionary <string, MessageProcessor>(StringComparer.OrdinalIgnoreCase); this.requestProcessors = new Dictionary <string, RequestProcessor>(StringComparer.OrdinalIgnoreCase); this.messageSources = new Dictionary <string, MessageSource>(StringComparer.OrdinalIgnoreCase); this.listeners = new ConnectionListener[addressList.Count]; for (int i = 0; i < addressList.Count; i++) { this.listeners[i] = new ConnectionListener(addressList[i], this); this.listeners[i].AMQP.ContainerId = this.containerId; } }