On Aug 31, 2004, at 5:13 PM, Frank Lfr wrote:
I'm just trying to test download times for URLs in succession,
but each must run to completion before the other can start. I
haven't been able to do that in RealBasic using the HTTPSocket
class. If I run asynchronously, it just kills the previous
download and starts over with the next one (which is also
killed by the next one .. only the last one runs).
That is what the HTTPSocket events are there for... if you add
the Socket to a Window, then you do not need to subclass the
HTTPSocket. Just type the code directly into the Socket events.
Basically, what you will want to do is have a start and end time
so you know how long all three files take to download.
Then in the DownloadComplete event, you can direct the Socket
to download the next file, or if all of the files are completed
then you can set the stop time.
Here is some sample code for the DownloadComplete event (using
Will's suggestion of an array):
Sub DownloadComplete(url as string, httpStatus as integer, headers as
internetHeaders, file as folderItem)
If UBound(URLlist) > -1 Then
Me.Get(URLlist.Pop)
Else
Self.Stoptime
End If
End Sub
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>
|