예제 #1
0
        public static LightUDP Create(IPAddress localIP, int localPort)
        {
            LightUDP udp = new LightUDP();

            for (int i = 0; i < 10; i++)
            {
                bool r = udp.Init(localIP, localPort + i);
                if (r == true)
                {
                    return(udp);
                }
            }
            return(udp);
        }
예제 #2
0
        public static LightUDP Create(string ip, int port)
        {
            LightUDP udp = new LightUDP();

            for (int i = 0; i < 10; i++)
            {
                bool r = udp.Init(IPAddress.Parse(ip), port + i);
                if (r == true)
                {
                    return(udp);
                }
            }
            return(udp);
        }