Esempio n. 1
0
        public void run()
        {
            int ServerPort        = 8310;
            int CommandServerPort = 8410;
            var nextUDP           = new UDPSystem(ServerPort, CommandServerPort);

            UDPSystems.Add(nextUDP);
            threads.Add(new Thread(new ThreadStart(UDPSystems[UDPSystems.Count - 1].Run)));
            threads[threads.Count - 1].Start();
            Console.ReadLine();
        }
Esempio n. 2
0
        private void Awake()
        {
            switch (device)
            {
            case 'A':
                udpSystem = new UDPSystem(null);
                udpSystem.Set(ipAddr, 5001, ipAddr2, 10020);
                break;

            case 'B':
                udpSystem = new UDPSystem((x) => Receive(x));
                udpSystem.Set(ipAddr2, 5002, ipAddr, 5001);
                udpSystem.Receive();
                break;
            }
        }