mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 03:45:35 +08:00
* 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:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user