Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. HttpWebRequest Timeout

HttpWebRequest Timeout

Scheduled Pinned Locked Moved C#
testingbeta-testingtutorialquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    albean
    wrote on last edited by
    #1

    I've been doing some testing with the HttpWebRequest object returned from WebRequest.Create(sURL) method and found that the timeout property is not very precise. It often times out after more than twice the value I set. For example it takes about 30 seconds for a timeout value of 15000. I’ve seen it take 15 seconds for a value of 5000. Plus or minus a few seconds I could let slip but what might be the reason for more than doubling the timeout value? (I tested the timeout by turning the power off to my cable modem. My computer is connected to the modem through a router which I left on.)

    A 1 Reply Last reply
    0
    • A albean

      I've been doing some testing with the HttpWebRequest object returned from WebRequest.Create(sURL) method and found that the timeout property is not very precise. It often times out after more than twice the value I set. For example it takes about 30 seconds for a timeout value of 15000. I’ve seen it take 15 seconds for a value of 5000. Plus or minus a few seconds I could let slip but what might be the reason for more than doubling the timeout value? (I tested the timeout by turning the power off to my cable modem. My computer is connected to the modem through a router which I left on.)

      A Offline
      A Offline
      Arun Bhalla
      wrote on last edited by
      #2

      Is this happening in a separate thread? How many threads might there be running simultaneously?

      A 1 Reply Last reply
      0
      • A Arun Bhalla

        Is this happening in a separate thread? How many threads might there be running simultaneously?

        A Offline
        A Offline
        albean
        wrote on last edited by
        #3

        I've been doing all my tests in a new "test" solution right in the constructor of Form1. So its only one thread. hmmm.... I wonder if its the debugger that is causing this. I will have to test it in a Release version.

        A 1 Reply Last reply
        0
        • A albean

          I've been doing all my tests in a new "test" solution right in the constructor of Form1. So its only one thread. hmmm.... I wonder if its the debugger that is causing this. I will have to test it in a Release version.

          A Offline
          A Offline
          Arun Bhalla
          wrote on last edited by
          #4

          Certainly try it outside of the debugger ("Start Without Debugging"). A Release build shouldn't be necessary, but it would be interesting if it did...

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups