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); }
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); }