Jump to content

InetGet doesn't return immediately with (..,1,1) param


KJohn
 Share

Recommended Posts

Progress(-1, "Attempting to connect... ")
    FileDelete(@TempDir &"\lc.cfg")
    InetGet( "VALID ADDRESS of an image", @TempDir &"\lc.cfg", 1,1)
    $timer=TimerInit()
    MsgBox(0,"check","debug")
               ;WAITING
    While @InetGetBytesRead==-1
        sleep(500)
        Progress(TimerDiff($timer),"Attempting to connect... ("&90-Round(TimerDiff($timer))&" secs to timeout)")
        If TimerDiff($timer)>90 Then ExitLoop
    WEnd
               ;IF CONNECTION SUCCESSFUL
    $timer=TimerInit()
    While @InetGetBytesRead<>-1 And @InetGetActive==1
        sleep(50)
        If TimerDiff($timer)>2000 Then ExitLoop
    WEnd
    InetGet("abort")
    
    FileDelete(@TempDir &"\lc.cfg")

The InetGet function is supposed to return rite (see parameters)? MsgBox(0,"check","debug") line gets executed only AFTER I click on 'allow' in my firewall program. I need a 90 second timeout to be displayed when an internet connection is not available or the user blocks it using a firewall.

Progress() is a UDF (no problems there).

Any solutions?

Link to comment
Share on other sites

It is not returning because it hasn't made a connection. The InetGet() function will return immediately once it has established a connection and has begun receiving data. It hasn't established the connection because your firewall keeps blocking it when it tries to do so. The best way around this is to simply not use the firewall or have it automatically allow the connection. There are also some udfs that have been written on the forum as alternatives to inetget. I will look for them and post an update.

EDIT:

This looks promising:

http://www.autoitscript.com/forum/index.ph...amp;hl=protocol

Edited by The Kandie Man

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...