示例#1
0
        public void Stop()
        {
            if (!IsRunning)
            {
                return;
            }

            HockSocketEvents(false);

            _beacon.Stop();
        }
示例#2
0
        private static void Main(string[] args)
        {
            Console.WriteLine("Any:{0}", IPAddress.Any);
            Console.WriteLine("Broadcast:{0}", IPAddress.Broadcast);
            Console.WriteLine("Loopback:{0}", IPAddress.Loopback);
            Console.WriteLine("None:{0}", IPAddress.None);

            if (IsWinXP())
            {
                AsyncIO.ForceDotNet.Force();
            }

            string name   = args.Length > 0 ? args[1] : "Console";
            Beacon beacon = new Beacon("Beacon", name);

            beacon.NodeConnected    += beacon_NodeConnected;
            beacon.NodeDisConnected += beacon_NodeDisConnected;
            beacon.Start();

            PrintAllNodes(beacon);

            string line;

            do
            {
                line = Console.ReadLine();
                if (line != null)
                {
                    PrintAllNodes(beacon);
                }
            } while (line != null);

            beacon.Stop();

            Console.ReadLine();
        }