/// <summary> /// Returns and reserves a new port /// </summary> public int GetNextOpenPort() { lock (_lock) { IPortWatcher portWatcher = PortWatcherFactory.CreatePortWatcher(); int newAvailablePort = portWatcher.FindOpenPort(_startPort); return(newAvailablePort); } }
/// <summary> /// Returns and reserves a new port /// </summary> public int GetNextOpenPort() { IPortWatcher portWatcher = PortWatcherFactory.CreatePortWatcher(); return(portWatcher.FindOpenPort()); }