Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 8 of 8 total
Thread Request Timeout
Sun, Apr 26 2015 10:32 PMPermanent Link

Eivind

All

I'm working on a project that will run on various devices used offshore in the oil & gas industry. That means from time to time an unstable satellite internet connection. On certain forms I have to load some data into combo boxes before the user can edit the form. To achieve that, I'm using a self designed spinner in EWB1, but have now converted to using the build in spinner / ShowProgress in EWB2. All is good until a network glitch occurs and the request never return. The user sits for minutes waiting for the request that never finish. A timeout would have to be implemented. After studying the webhttp unit, I cannot find a request timeout parameter so I ended up adding one. In the TServerRequest.Execute, just after the FHttpRequest.open() I added FHttpRequest.timeout := 45000;

This works like a charm. All the browsers I have tested this on times out the request after 45 seconds. I now can close the spinner and the loading form and tell the user to please try again. This results in happy users and a 90% reduction in support tickets. Yihaaa!

Anyhow, I was just wondering if there was any reason why this timeout parameter was not added by Elevate originally? Does adding this parameter break something else? For me it's absolutely crucial to have this timeout set. If I set the timeout, would this also affect the file upload as well?

Does anyone else run in to this issue before?

Thanks

Eivind
Mon, Apr 27 2015 4:25 AMPermanent Link

Matthew Jones

Eivind wrote:

>  In the TServerRequest.Execute, just after the FHttpRequest.open() I
> added FHttpRequest.timeout := 45000;

Hmm, interesting. Do you not get the OnFail events? Hmm, no, that is
how the RemObjects SDK handles this I realise. And why I've not met
this. Okay, this does sound like a sensible thing to have surfaced in
the future versions. Perhaps even through a "global" mechanism to set a
default timeout for all, as well as a per request timeout.

--

Matthew Jones
Mon, Apr 27 2015 8:21 AMPermanent Link

Raul

Team Elevate Team Elevate

On 4/26/2015 10:32 PM, Eivind wrote:
> Anyhow, I was just wondering if there was any reason why this timeout parameter was not added by Elevate originally? Does adding this parameter break something else? For me it's absolutely crucial to have this timeout set. If I set the timeout, would this also affect the file upload as well?
> Does anyone else run in to this issue before?

Good idea for it to be surfaced.

AFAIK this has some implementation specific issues (i.e. cross browser
compatibility) but one would hope those have been resolved now.

Alternative is to use a timer and call serverrequest Cancel method

Raul
Mon, Apr 27 2015 5:35 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Eivind,

<< Anyhow, I was just wondering if there was any reason why this timeout
parameter was not added by Elevate originally? >>

It's just a newer addition in modern browsers that didn't get picked up in
the original implementation.  I can add it to EWB1 and EWB2.

Tim Young
Elevate Software
www.elevatesoft.com


Mon, Jun 15 2015 4:06 PMPermanent Link

Doug B

It looks like this still hasn't been implemented in EWB 2 build 12.

Doug

>>
It's just a newer addition in modern browsers that didn't get picked up in
the original implementation.  I can add it to EWB1 and EWB2.

Tim Young
Elevate Software
www.elevatesoft.com
>>

Mon, Jun 15 2015 4:16 PMPermanent Link

Doug B

As a matter of fact, I don't see a timeout property declared anywhere, so the OP's code doesn't work either, at least not in the latest build.

Doug B wrote:

It looks like this still hasn't been implemented in EWB 2 build 12.

Doug

>>
It's just a newer addition in modern browsers that didn't get picked up in
the original implementation.  I can add it to EWB1 and EWB2.

Tim Young
Elevate Software
www.elevatesoft.com
>>

Mon, Jun 15 2015 5:00 PMPermanent Link

Raul

Team Elevate Team Elevate

On 6/15/2015 4:16 PM, Doug B wrote:
> As a matter of fact, I don't see a timeout property declared anywhere, so the OP's code doesn't work either, at least not in the latest build.

You need to add it yourself for now - declare the timeout in webdom
(search for external declaration for XMLHttpRequest).
Should add the ontimeout handler event as well and then also update the
webhttp to use the timeout (add property and setter for example that
updates the underlying XMLHttpRequest as well).

I'm sure it's in the list so it will show up in future build also.

Raul
Tue, Jun 16 2015 7:52 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Doug,

<< It looks like this still hasn't been implemented in EWB 2 build 12. >>

Yep, I've stopped adding new stuff to EWB 2.x so that we can release the
product.  This will get picked up in one of the minor releases after the
initial 2.00 release.

Tim Young
Elevate Software
www.elevatesoft.com


Image