Results 1 to 4 of 4

Thread: Timeout and winsock

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2003
    Location
    Brisbane, Australia
    Posts
    72

    Timeout and winsock

    I'm just starting to use winsock and couldn't for the life of me come up with an effective way to detect timeout on connection.

    Can anyone help me?

  2. #2
    Addicted Member
    Join Date
    Feb 2003
    Posts
    237
    you pretty much have to implement one for yourself with an extra timer control,

    then somewhere in your code you go into a feedback loop waiting for xxx=true like

    VB Code:
    1. 'connect and stuff
    2. timer1.enabled =true
    3.  
    4. while not downloadcomplete
    5.   sleep 60
    6.   doevents
    7.   if timer1.enabled = false then
    8.     msgbox "timed out"
    9.   end if
    10. wend
    11.  
    12. sub timer1_timer()
    13.     timer1.enabled =false
    14. end sub
    Free Code, papers, tools, and more

    http://sandsprite.com

  3. #3
    Addicted Member
    Join Date
    Feb 2003
    Posts
    237
    oops forgot after msgbox exit loop
    Free Code, papers, tools, and more

    http://sandsprite.com

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jul 2003
    Location
    Brisbane, Australia
    Posts
    72
    Thanks for the help. I came up with a similar idea and it works pretty well.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width