コード例 #1
0
        private void ConfigureWithProxyNodeSettings()
        {
            IPEndPoint proxyEndPoint = StartupConfigManager.Default.GetProxyEndPoint();

            if (proxyEndPoint == null)
            {
                Console.Out.WriteLine("Proxy IP Address and/or port are not found in the configuration file.");
                Environment.Exit(1);
            }

            CommunicationMediator = new ProxyBasedCommunicationMediator
            {
                ProxyEndPoint = proxyEndPoint
            };
        }
コード例 #2
0
        private void ConfigureWithDiscoveryServiceSettings()
        {
            IPEndPoint multicastIpEndPoint = StartupConfigManager.Default.GetDiscoveryClientMulticastIPEndPoint();

            if (multicastIpEndPoint == null)
            {
                Console.Out.WriteLine("Multicast IP Address and port are not found in the configuration file.");
                Environment.Exit(1);
            }

            int responseTcpPort = StartupConfigManager.Default.GetDiscoveryClientResponseTcpPort();

            if (responseTcpPort == -1)
            {
                Console.Out.WriteLine("Discovery response TCP port is not indicated within configuration file.");
                Environment.Exit(1);
            }

            CommunicationMediator = new DiscoveryBasedCommunicationMediator
            {
                MulticastIPEndPoint = multicastIpEndPoint
            };
        }