public UserAgentServiceConnector(string url, bool dnsLookup)
{
m_ServerURL = url;
if (dnsLookup)
{
// Doing this here, because XML-RPC or mono have some strong ideas about
// caching DNS translations.
try
{
Uri m_Uri = new Uri (m_ServerURL);
IPAddress ip = NetworkUtils.GetHostFromDNS(m_Uri.Host);
m_ServerURL = m_ServerURL.Replace (m_Uri.Host, ip.ToString ());
if (!m_ServerURL.EndsWith ("/"))
m_ServerURL += "/";
}
catch (Exception e)
{
MainConsole.Instance.DebugFormat ("[USER AGENT CONNECTOR]: Malformed Uri {0}: {1}", m_ServerURL, e.Message);
}
}
MainConsole.Instance.DebugFormat ("[USER AGENT CONNECTOR]: new connector to {0} ({1})", url, m_ServerURL);
}