On my Win7 PC I have a couple of virtual network adaptors that are used for VMWare server. My HttpWebRequest times out when I have these adaptors enabled. Should I really have to tell it which adaptor to bind to?
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url.AbsoluteUri + "etc.txt");
request.Timeout = 2000;
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
{
using (StreamReader reader = new StreamReader(response.GetResponseStream()))
{
return reader.ReadToEnd();
}
}
UPDATE
I'm guessing this is a common issue. Does anybody have a standard way to handle this? I cant really prompt the user for the interface as they are non tech. Rohit's answer is good start at showing how to set the ServicePoint.