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: Will Leshner <leshner at ljug dot com>
Date: Mon, 30 Aug 2004 11:14:14 -0700
Delivered-to: gettingstarted at lists dot realsoftware dot com
References: <BAY12-DAV8BX3mL82et0000694e at hotmail dot com>
Frank Lfr wrote:


1) When I call an instance of the HTTPSocket class by dragging the control onto 
a window and then calling it, I can't seem to get my custom events to trigger 
(like PageReceived).  I call it this way:  Call http.get (testURL(i),60).  The 
odd thing is, the events do trigger if I just run http.get (testURL(i)), but 
then the first 2 URLs don't download completely .. only the last one.  Any way 
I can trigger HTTPSocket events and make sure each download runs to completion?

With HTTPSocket, you've basically got two choices. You can either use them 
synchronously, which is what you get if you specify a timeout, or you can use 
them asynchronously, which is what you get if you just specify a URL with no 
timeout. But if you use them synchronously then you don't get your events 
called. On the other hand, if you use them asynchronously, then you can't issue 
another Get using the same socket until you are finished getting the results 
from the previous Get. So either you should stop ignoring the return value of 
the synchronous call (which is what happens if you use the Call keyword), or 
you should do things in an event-driven fashion and not issue the next Get 
until the previous Get has finished.


--
REALbasic database options: http://sqlabs.net
REALbasic news and tips: http://rbgazette.com
KIdzMail & KidzLog: http://haranbanjo.com
_______________________________________________
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>