Runt.DesignTimeHost.Host.FreeTcpPort C# (CSharp) Method

FreeTcpPort() static private method

static private FreeTcpPort ( ) : int
return int
        static int FreeTcpPort()
        {
            TcpListener l = new TcpListener(IPAddress.Loopback, 0);
            l.Start();
            int port = ((IPEndPoint)l.LocalEndpoint).Port;
            l.Stop();
            return port;
        }