Why the HttpRequest Timeout?

問題 Why the HttpRequest Timeout?

  • 2009年2月2日 上午 06:31
     
      包含代碼
    Hello everyone , i just had a problem about HttpRequest Timeout , my codes below.

    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    HttpWebRequest httpRequest = (HttpWebRequest)HttpWebRequest.Create(reportUri);

    httpRequest.ContentType = "application/x-www-form-urlencoded";

    httpRequest.Method = "GET";

    httpRequest.Timeout = 1000*30;

    httpRequest.UserAgent = this.userAgent;

    //Stream str=httpRequest.GetRequestStream();

    httpResponse = (HttpWebResponse)httpRequest.GetResponse();

    xmlReport.ReportSender.StatusCode = (int)httpResponse.StatusCode;

    xmlReport.ReportSender.Error = string.Empty;

    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    this is just a part of the code in "for" circle , i really send two request to server successful , but the third time , i get the time out Error , but i don't know why , could anyone here help me?

    thanks very much..


    Jing Guo's Facebook profile