gettingstarted
[Top] [All Lists]

Re: Running Events in HTTPSocket

To: Getting Started <gettingstarted at lists dot realsoftware dot com>
Subject: Re: Running Events in HTTPSocket
From: Phil Mobley <phil at mobleybros dot com>
Date: Tue, 31 Aug 2004 17:24:04 -0700
Delivered-to: gettingstarted at lists dot realsoftware dot com
References: <20040831163938 dot D030E41E040 at lists dot realsoftware dot com><BAY12-DAV18oVexDAey000095d2 at hotmail dot com> <0FA943A6-FB7E-11D8-9661-000A95983FBE at ljug dot com> <BAY12-DAV7alkXh3wFD0000c95d at hotmail dot com>
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>

<Prev in Thread] Current Thread [Next in Thread>