Fixed DNS resolve bug for Grid mode on multi-Homer systems.

afrisby
Tedd Hansen 2007-09-12 05:37:46 +00:00
parent 6ca6c035e7
commit 5ade01bb49
2 changed files with 8 additions and 0 deletions

View File

@ -164,6 +164,7 @@ namespace OpenSim.Framework.Data
ArrayList SendParams = new ArrayList(); ArrayList SendParams = new ArrayList();
SendParams.Add(requestData); SendParams.Add(requestData);
XmlRpcRequest GridReq = new XmlRpcRequest("simulator_data_request", SendParams); XmlRpcRequest GridReq = new XmlRpcRequest("simulator_data_request", SendParams);
Console.WriteLine("Requesting response from GridServer URL: " + gridserver_url);
XmlRpcResponse GridResp = GridReq.Send(gridserver_url, 3000); XmlRpcResponse GridResp = GridReq.Send(gridserver_url, 3000);
Hashtable responseData = (Hashtable)GridResp.Value; Hashtable responseData = (Hashtable)GridResp.Value;

View File

@ -249,6 +249,13 @@ namespace OpenSim.Framework.Utilities
/// <returns>An IP address, or null</returns> /// <returns>An IP address, or null</returns>
public static IPAddress GetHostFromDNS(string dnsAddress) public static IPAddress GetHostFromDNS(string dnsAddress)
{ {
// Is it already a valid IP? No need to look it up.
IPAddress ipa;
if (IPAddress.TryParse(dnsAddress, out ipa))
return ipa;
// Not an IP, lookup required
IPAddress[] hosts = Dns.GetHostEntry(dnsAddress).AddressList; IPAddress[] hosts = Dns.GetHostEntry(dnsAddress).AddressList;
foreach (IPAddress host in hosts) foreach (IPAddress host in hosts)