I've got a Browser Helper Object written in C# that makes a HTTPWebRequest POST to my server when the user clicks a button on a windows form, and in the normal case this works great. However, every so often, I'll get a BHO that seems to go crazy and continually send me a huge number of HTTPWebRequests (around 50 to 100 per minute). The only way I've been able to stop the behavior to have the client reboot their PC, often the users have even closed IE, but the POSTs keep rolling in.
Has anyone ever seen a similar behavior when using HTTPWebRequest? It almost seems like some retry logic in the connection is going crazy, but I didn't think HTTPWebRequest had any retry mechanism built in, so that seems very unlikely.
I'm setting up my connection incorrectly and is there a good strategy for preventing something like this?
Here is how I'm setting up my connection:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
HttpWebRequest webRequest = (HttpWebRequest)HttpWebRequest.Create(myUrl);
webRequest.Timeout = 30000;
webRequest.Method = "POST";
webRequest.KeepAlive = false;
System.Net.ServicePointManager.Expect100Continue = false;
webRequest.ContentType = "text/xml";
webRequest.ContentLength = myData.Length;
using (StreamWriter requestWriter = new StreamWriter(webRequest.GetRequestStream()))
{
requestWriter.Write(this.myData);
requestWriter.Close();
}