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 13:42:13 -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>
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>

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