Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GetReponse Timeout on 3rd Attempt

Status
Not open for further replies.

RobHudson

Programmer
Apr 30, 2001
172
GB
Hi

I have a .NET 1.1 app that is using a WebRequest/GetResponse to call a php script on a web server. The first 2 times the process is run it completes fine. On the 3rd attempt I get a timeout error "The operation has timed out".

I have tried this on 2 different PCs and making the call to 2 different web servers (one windows and one linux).

Here's the code:

Code:
WebRequest wrq = WebRequest.Create(String.Concat(BACK_UP_LOCATION, "backup.php", sQ));
wrq.Timeout = 10000;
WebResponse wrs = wrq.GetResponse(); // Errors here...
StreamReader sr = new StreamReader(wrs.GetResponseStream(), Encoding.ASCII);
s.Append(sr.ReadToEnd());
wrs.Close();
wrs = null;
wrq = null;

Changing the timeout to a longer term does not help :(

Any ideas? Why would it timeout on the 3rd attempt and not the others?

Thanks Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top