Apache.NMS.ActiveMQ.Transport.Tcp.TcpTransportFactory.GetIPHostEntry C# (CSharp) Method

GetIPHostEntry() public static method

public static GetIPHostEntry ( string host ) : IPHostEntry
host string
return System.Net.IPHostEntry
        public static IPHostEntry GetIPHostEntry(string host)
        {
            IPHostEntry ipEntry;

            #if CACHE_HOSTENTRIES
            string hostUpperName = host.ToUpper();

            lock (_syncLock)
            {
                if (!CachedIPHostEntries.TryGetValue(hostUpperName, out ipEntry))
                {
                    try
                    {
                        ipEntry = Dns.GetHostEntry(hostUpperName);
                        CachedIPHostEntries.Add(hostUpperName, ipEntry);
                    }
                    catch
                    {
                        ipEntry = null;
                    }
                }
            }
            #else
            try
            {
                ipEntry = Dns.GetHostEntry(host);
            }
            catch
            {
                ipEntry = null;
            }
            #endif

            return ipEntry;
        }