HttpWebRequest and Vista Business

D

David W

I am using the following code to send a request to a web site. It works
fine on XP and Vista Home, but on a machine running Vista Business it gives
the error, ConnectFailure. I can browse to the site in IE7 on the same
laptop with no problem. This code works fine on other computers on the same
network. There is a firewall there, but no proxy. Are there any know
issues for this scenario?

-Dave

HttpWebRequest req;
req = (HttpWebRequest)WebRequest.Create("https://" + Global.WebServer +
Global.WebPath + serverUrl);
req.AllowWriteStreamBuffering = true;
req.Method = "POST";
req.ContentType = "application/x-www-form-urlencoded";
req.Timeout = Global.InetTimeout * 1000;
req.SendChunked = true;
req.Proxy = HttpWebRequest.DefaultWebProxy;
ASCIIEncoding encodedData = new ASCIIEncoding();
byte[] btPostData;
btPostData = HttpUtility.UrlEncodeToBytes(encodedData.GetBytes(postData));
Stream reqStream = req.GetRequestStream();
reqStream.Write(btPostData, 0, btPostData.Length);
reqStream.Close();
HttpWebResponse resp = (HttpWebResponse) req.GetResponse();
 
B

Bryan Phillips

There is a weird bug with the built-in firewall functionality in Vista
where it somehow runs out of outbound TCP connections. Try stopping the
"Base Filtering Engine" service (and any dependent services) and try
running the code again. If it works, you just ran into the bug.
Usually, a reboot fixes this rare but annoying problem. I usually run
into it 1-2 times a month after leaving my laptop running for a few
weeks.
 
D

David W

Arghh, it was Norton internet security. A trial version of this software
had been preloaded on the laptop. I can't beleive I didn't check for that -
Norton "IS" the virus and is the first thing I rip off any machine!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top