Jump to content

Strange behavior of InetClose()...


Tersion
 Share

Recommended Posts

Here simple script:

#include <InetConstants.au3>

Local $hDownload

$hDownload = InetGet("http://www.autoitscript.com/autoit3/files/beta/update.dat", @ScriptDir & "\test.txt", $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND)
ConsoleWrite(@error)
Sleep(5000)
$bReturn = InetClose($hDownload)
MsgBox(0, "", $bReturn)

The reference says:

Return Value

True: if the handle was found and closed.

False: if not.

But I get always: False? I guess there should be True... Why that? Something wrong? Downloaded text file open as normal. @error = 0

Link to comment
Share on other sites

I agree. Very weird. This

Local $hDownload = InetGet("https://www.autoitscript.com/autoit3/files/archive/autoit/autoit-v3.3.14.5-setup.exe", @ScriptDir & "\test.exe", 1, 1)
ConsoleWrite($hDownload & @crlf)
ConsoleWrite(@error & @crlf)
;Sleep(10000)
$bReturn = InetClose($hDownload)
ConsoleWrite($bReturn & @crlf)
ConsoleWrite($hDownload & @crlf)

while the download is effectively interrupted, returns :

1
0
False
1

 

Link to comment
Share on other sites

mikell,

Yes. Thanks that you mention about that interrupted download returns the same. It's looks like some bug, or just typo the AutoIt code. In that sort of situation it's bad that the AutoIt code is closed.

I decide to create ticket in Bug Tracker.

By the way, I had another problem with InetClose()...

Edited by Tersion
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

×
×
  • Create New...