S
Steve Richter
I am using Dns.GetHostByAddress and Dns.Resolve to successfully
resolve and IP address to an IPEndPoint.
IPEndPoint ep = null;
IPAddress ipAddr = IPAddress.Parse(m_sRemoteHost);
ep = new IPEndPoint(Dns.GetHostByAddress(ipAddr).AddressList[0],
m_iRemotePort);
// ep = new IPEndPoint(Dns.GetHostEntry(ipAddr).AddressList[0],
m_iRemotePort);
// ep = new IPEndPoint(Dns.Resolve(m_sRemoteHost).AddressList[0],
m_iRemotePort);
but the compiler complains, saying these methods are obsolete and are
replaced by GetHostEntry. When I use the GetHostEntry method the code
fails with an "no such host is known" exception.
Why would GetHostByAddress succeed and GetHostEntry fail?
thanks,
-Steve
resolve and IP address to an IPEndPoint.
IPEndPoint ep = null;
IPAddress ipAddr = IPAddress.Parse(m_sRemoteHost);
ep = new IPEndPoint(Dns.GetHostByAddress(ipAddr).AddressList[0],
m_iRemotePort);
// ep = new IPEndPoint(Dns.GetHostEntry(ipAddr).AddressList[0],
m_iRemotePort);
// ep = new IPEndPoint(Dns.Resolve(m_sRemoteHost).AddressList[0],
m_iRemotePort);
but the compiler complains, saying these methods are obsolete and are
replaced by GetHostEntry. When I use the GetHostEntry method the code
fails with an "no such host is known" exception.
Why would GetHostByAddress succeed and GetHostEntry fail?
thanks,
-Steve