* Adds new NetworkUtil class, contains methods for handling IP resolution when located on the same subnet. (Eg, can be used to avoid NAT Loopback requirements if fully utilized.)

* Adds a few new network-related methods to Util.
This commit is contained in:
Adam Frisby
2009-05-23 05:09:10 +00:00
parent 1be22bc626
commit 2d06135166
2 changed files with 136 additions and 0 deletions

View File

@@ -517,6 +517,20 @@ namespace OpenSim.Framework
return null;
}
public static Uri GetURI(string protocol, string hostname, int port, string path)
{
return new UriBuilder(protocol, hostname, port, path).Uri;
}
/// <summary>
/// Gets a list of all local system IP addresses
/// </summary>
/// <returns></returns>
public static IPAddress[] GetLocalHosts()
{
return Dns.GetHostAddresses(Dns.GetHostName());
}
public static IPAddress GetLocalHost()
{
string dnsAddress = "localhost";