Exemple #1
0
        public void SendHeartbeat()
        {
            while (true)
            {
                broadCastTransport.Send(new Heartbeat()
                {
                    HostId      = hostId,
                    IpAddresses = IPAddressUtility.LocalIpAddresses()
                });

                Thread.Sleep(1000);
            }
        }
Exemple #2
0
        public async void AllTest()
        {
            (var v4, var v6) = await IPAddressUtility
                               .GetLocalIPv4AndIPv6AddressAsync()
                               .ConfigureAwait();

            Assert.True(v4.IsIPv4());
            Assert.True(v6.IsIPv6());

            Assert.False(v4.IsIPv4Loopback());
            Assert.False(v6.IsIPv6Loopback());

            Assert.False(v4.IsLoopback());
            Assert.False(v6.IsLoopback());
        }
Exemple #3
0
        public WcfCache()
        {
            string conn = ConfigurationManager.AppSettings["Smart:WcfCache"] ?? string.Format("{0}:9379", IPAddressUtility.GetLocalIPAddress());

            this.cacheClient  = new WcfClient <ICacheService>(string.Format("net.tcp://{0}", conn), null, null);
            this.cacheService = this.cacheClient.CreateService();
        }