c# - Strange Timeout WebException in HTTP Get using WebClient -
I have a multi-threaded application) (C # which multiple HTTP GET
Yuri does. Suddenly after thousands of requests, I get timeout web expption but the destination server is fine if I do a test using the browser. The code is:
get public static string (string yuri) {string responseData = string.Empty; (Using WebClient wc = new WebClient ()) {responseData = wc.DownloadString (uri); } Return feedback data; }
I think this connection problem or similar error is disposed of any body has the same problem?
Thx in advance,
PS I have also used HttpWebResponse
but I get the same error.
The PS OS is Windows Server 2003 so I do not have that connection limit.
I've also tried with this code and I get the same error
public static Strait Get2 (string Yuri) {string response Data = string .Empty; WebRequest request = WebRequest.Create (Yuri) as HttpWebRequest; request. Method = "received"; request. Time = 35000; (HttpWebResponse response = (HttpWebResponse) request.GetResponse () using {as HttpWebResponse) (DataStream stream = using {Using response.GetResponseStream ()) (StreamReader reader = new StreamReader (DataStream)) {responseData = Reader.ReadToEnd (); }}} Return feedback data; } -
Is the server also your code?
You've probably thought about ending your server handling all your resources and that's just plain and simple restart thats when you're doing a query that's why you There is an expiration but since time you have to browser ping , it is back up. Just an idea
, since you mention "thousands of requests", I'm more interested to think in a processing crisis on the server than with a connectivity problem.
Comments
Post a Comment