/// <summary>
        /// Creates a SslBrokerClient instance.
        /// </summary>
        /// <param name="hostInfo">Information about an agent.</param>
        /// <param name="collection">A collection of X.509 certificates. Useful when agents are not using a key that can be validated by a trusted X.509 certificate.</param>
        public SslBrokerClient(HostInfo hostInfo, X509CertificateCollection collection)
        {
            IList<HostInfo> hosts = new List<HostInfo>(1);
            hosts.Add(hostInfo);

            this.hosts = hosts;
            SslNetworkHandler sslNetHandler = new SslNetworkHandler(hosts, collection);
            protocolHandler = new BrokerProtocolHandler(messageSerializer, sslNetHandler);
        }
Beispiel #2
0
        /// <summary>
        /// Creates a BrokerClient instance and connects to an agent.
        /// </summary>
        /// <param name="hostInfo">Information about an agent.</param>
        public BrokerClient(HostInfo hostInfo)
        {
            IList<HostInfo> hosts = new List<HostInfo>(1);
            hosts.Add(hostInfo);

            this.hosts = hosts;
            NetworkHandler networkHandler = new NetworkHandler(hosts);
            protocolHandler = new BrokerProtocolHandler(messageSerializer, networkHandler);
            protocolHandler.OnCommunicationFailed += new CommunicationFailed(HandleOnCommunicationFailed);
        }
Beispiel #3
0
 /// <summary>
 /// Creates a BrokerClient instance and connects to an agent.
 /// </summary>
 /// <param name="hosts">Information about agents.</param>
 public BrokerClient(IList<HostInfo> hosts)
 {
     this.hosts = hosts;
     NetworkHandler networkHandler = new NetworkHandler(hosts);
     protocolHandler = new BrokerProtocolHandler(messageSerializer, networkHandler);
 }