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 / C++ / MFC
  4. How can use Time Out for any function or thread?

How can use Time Out for any function or thread?

Scheduled Pinned Locked Moved C / C++ / MFC
question
4 Posts 4 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.
  • L Offline
    L Offline
    Le rner
    wrote on last edited by
    #1

    Hi all, i checking the link status some times it takes so much time i want if the link status is not return in 2 min its time out this function and process further commands and functions. please tell me how can i do this. thanks in advance.

    M D Y 3 Replies Last reply
    0
    • L Le rner

      Hi all, i checking the link status some times it takes so much time i want if the link status is not return in 2 min its time out this function and process further commands and functions. please tell me how can i do this. thanks in advance.

      M Offline
      M Offline
      Moak
      wrote on last edited by
      #2

      There are non-blocking sockets or HTTP libraries/classes you could use. Good luck! :)

      Chat in Europe :java: Now with 24% more Twitter

      1 Reply Last reply
      0
      • L Le rner

        Hi all, i checking the link status some times it takes so much time i want if the link status is not return in 2 min its time out this function and process further commands and functions. please tell me how can i do this. thanks in advance.

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        When I did this, I called HttpSendRequest() in a separate thread. See MSDN article Q224318 for details.

        "One man's wage rise is another man's price increase." - Harold Wilson

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        "Man who follows car will be exhausted." - Confucius

        1 Reply Last reply
        0
        • L Le rner

          Hi all, i checking the link status some times it takes so much time i want if the link status is not return in 2 min its time out this function and process further commands and functions. please tell me how can i do this. thanks in advance.

          Y Offline
          Y Offline
          yu jian
          wrote on last edited by
          #4

          If you use the nested loop do something. you can count the time, if overtime, show one your timeout excetpion to goto the outest .

          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