On Aug 31, 2004, at 11:37 AM, Frank Lfr wrote:
I've tried to set the timeout longer, but it still won't run any
events (even ReceiveProgress) if I call the instance using http.get
(testURL(i),60) format within my loop. The only way I can run events
is if I call the instance asynchronously (which isn't what I'm trying
to do). Is there any way to run events synchronously using a timeout
value?
I ran into this problem myself, and no events are fired if you are
running the port synchronously.
Because of this, I had to change around my entire workflow, but the
result is much better.
I had to Subclass the HTTPSocket and a Timer, and made the timer a
property of the HTTPSocket subclass. Then I created my own Get method,
and instanced the Timer along with a Date object (set to the timeout
period). The timer fires every 500 ms and checks the current Date to
the Timeout Date property, so it is pretty close to the amount entered
in the timeout property of my custom Get.
Then in your ReceiveProgress event, you will want to update the Date
(to extend the timeout) so that you do not cancel the quit before the
download is complete. In this case, the timeout would only work if you
are disconnected from the server in the middle of the download --
otherwise the ReceiveProgress event would never be fired and the Error
event would be instead.
I will try to put together something so that you can see what I am
talking about.
_______________________________________________
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>
|