Cassini Configuration API Documentation

Metabase.FindFreeEphemeralPort Method 

Finds a TCP port that is not in use on the system.

[Visual Basic]
Public Shared Function FindFreeEphemeralPort() As Integer
[C#]
public static int FindFreeEphemeralPort();

Remarks

This method can potentially return the port set aside for a Cassini application that is not running. Use FindFreeTcpPort() method to get a port that will not only be unbound, but also not used by any of the Cassini applications.

See Also

Metabase Class | CassiniConfiguration Namespace