mvcall timeout

20 views
Skip to first unread message

wmgilligan

unread,
Apr 17, 2006, 3:21:26 PM4/17/06
to miva-script
Any one have any examples of using the timeout in mvcall, and how to
handle it when it reaches that point?

Bill

bi...@billbuilt.com

unread,
Apr 17, 2006, 4:38:17 PM4/17/06
to miva-...@googlegroups.com
Hi,
I don't think you can reference the calltimeout variable from your scripts
(at least in V4. I vaguely remember reading something about a new variable
available in v5 where you can get/set this dynamically, but who knows, the
docs are so scattered and incomplete.) If you know what it is, you can
determine the elapsed time inside your MvCALL loop with something like this:

<MvASSIGN NAME="l.calltimeout_value" VALUE="90">
<MvASSIGN NAME="l.now" VALUE="{s.dyn_time_t}">

<MvCALL ACTION="URL"
METHOD="POST|GET"
FIELDS="var1,var2,var3,...">

....SOME CODE HERE...
<MvIF EXPR="{(s.dyn_time_t - l.now) GT (l.calltimeout_value-10)}">
(There's 10 or less seconds left before timeout occurs)
</MvIF>

</MvCALL>

HTH,
Bill M.

Bill Guindon

unread,
Apr 17, 2006, 5:26:59 PM4/17/06
to miva-...@googlegroups.com
On 4/17/06, wmgilligan <bi...@gilliganonline.com> wrote:
>
> Any one have any examples of using the timeout in mvcall, and how to
> handle it when it reaches that point?

Just a guess mind you...

"MvCALL takes a new attribute "TIMEOUT". This value is used if it is
smaller than the configured MvCONFIG_CALL_TIMEOUT value."

It sounds like they're trying to give you a chance to clean things up,
and/or report that the call failed before the call triggers a script
timeout (based on the fact that it's only used if shorter than the
config timeout).

What I don't see, is an obvious way to be sure that the call
completed. I suppose you could look for a closing </html> tag, and
assign l.done to 1 when you see it. Then below the call, you could
'IF l.done "call succeeded" ELSE "call failed"' (or whatever you need
to do in either case).


> Bill
>
>
> >
>


--
Bill Guindon (aka aGorilla)
The best answer to most questions is "it depends".

bi...@billbuilt.com

unread,
Apr 17, 2006, 6:22:07 PM4/17/06
to miva-...@googlegroups.com
Bill,

> "MvCALL takes a new attribute "TIMEOUT". This value is used
> if it is smaller than the configured MvCONFIG_CALL_TIMEOUT value."

Is that v5? Is it me, or does the need to make the timeout smaller not make
any sense? At the moment, I can't think of any time I needed it smaller.
Being able to increase it would make more sense to me.


>I suppose you could look for a closing </html>
> tag, and assign l.done to 1 when you see it.

I think that's be ok if you were calling pages you wrote, otherwise, there
may not be a </html> tag. Some of the pages I have written, (php helper
scripts, etc.) only return raw data and not any html, as nothing gets
displayed to the browser. I am guessing that MvCALL will continue until the
server tells it that the page is done, or the timeout is reached. If so,
then if the call completed, (that is the server told empressa that it was
done), the 1st line after </MvCALL> will be executed. That is where I would
put l.done=1, enclosing it in an "if (NOT MvCALL_ERROR)" condition. (I'm
assuming that it would be set if the timeout is reached, however I don't
believe I've ever tested it.)

Just my 2.3 cents ;)

Bill M.

Bill Guindon

unread,
Apr 17, 2006, 6:50:00 PM4/17/06
to miva-...@googlegroups.com
On 4/17/06, bi...@billbuilt.com <bi...@billbuilt.com> wrote:
>
> Bill,
>
> > "MvCALL takes a new attribute "TIMEOUT". This value is used
> > if it is smaller than the configured MvCONFIG_CALL_TIMEOUT value."
>
> Is that v5? Is it me, or does the need to make the timeout smaller not make
> any sense? At the moment, I can't think of any time I needed it smaller.
> Being able to increase it would make more sense to me.

Yep, it's v5. You'd want to reduce it in an attempt to buy enough
time to clean up (close files, etc.), and report the error. If it
runs until the server times out, then the server just stops the
script, and you have no chance to explain why.

>
> >I suppose you could look for a closing </html>
> > tag, and assign l.done to 1 when you see it.
>
> I think that's be ok if you were calling pages you wrote, otherwise, there
> may not be a </html> tag. Some of the pages I have written, (php helper
> scripts, etc.) only return raw data and not any html, as nothing gets
> displayed to the browser. I am guessing that MvCALL will continue until the
> server tells it that the page is done, or the timeout is reached. If so,
> then if the call completed, (that is the server told empressa that it was
> done), the 1st line after </MvCALL> will be executed. That is where I would
> put l.done=1, enclosing it in an "if (NOT MvCALL_ERROR)" condition. (I'm
> assuming that it would be set if the timeout is reached, however I don't
> believe I've ever tested it.)

Silly me, wasn't even thinking of the MvCALL_Error, yeah, that should
be your trigger. If it's true report the error, otherwise, move on
with your work.

PS: If Bill Weiland jumps in this thread, it's gonna get really tough
to follow ;)

Bill Gilligan

unread,
Apr 17, 2006, 10:33:35 PM4/17/06
to miva-...@googlegroups.com
Hi Bill,
In the new empressa there is an actual timeout function.
But so far I haven't found any info on it.

Bill


=============================
Bill Gilligan
Gilligan On-Line
www.gilliganonline.com
727-373-2536

> -----Original Message-----
> From: miva-...@googlegroups.com
> [mailto:miva-...@googlegroups.com] On Behalf Of bi...@billbuilt.com
> Sent: Monday, April 17, 2006 3:38 PM
> To: miva-...@googlegroups.com
> Subject: [miva] Re: mvcall timeout
>
>

Bill Gilligan

unread,
Apr 17, 2006, 10:38:47 PM4/17/06
to miva-...@googlegroups.com
Hi Bill,
I have the script complete - and I do an mvcall once I see a certain line of text.
My issue now is - the server is not available, so I want to end the call nicely if this happens.
Say, 5 seconds without a response, then gracefully finish...

But - what is returned when the timeout times out?

Bill

=============================
Bill Gilligan
Gilligan On-Line
www.gilliganonline.com
727-373-2536

> -----Original Message-----
> From: miva-...@googlegroups.com
> [mailto:miva-...@googlegroups.com] On Behalf Of Bill Guindon
> Sent: Monday, April 17, 2006 4:27 PM
> To: miva-...@googlegroups.com
> Subject: [miva] Re: mvcall timeout
>
>

Bill Gilligan

unread,
Apr 17, 2006, 10:44:04 PM4/17/06
to miva-...@googlegroups.com
So,
A simple MvCall_Error ?

Like...
If mvCall error, then THIS TIMED OUT
Else
Keep going

=============================
Bill Gilligan
Gilligan On-Line
www.gilliganonline.com
727-373-2536

Bill Gilligan

unread,
Apr 17, 2006, 10:44:04 PM4/17/06
to miva-...@googlegroups.com
Hi Bill,
The timeout is made smaller so you can gracefully close a script before it times out....

Bill

=============================
Bill Gilligan
Gilligan On-Line
www.gilliganonline.com
727-373-2536

bi...@billbuilt.com

unread,
Apr 17, 2006, 11:42:21 PM4/17/06
to miva-...@googlegroups.com
Bill,
Well, sort-of. MvCALL_ERROR could return any number of different errors. You
could set your timeout value to a very low number then do a test call and
display the MvCALL_ERROR value to see for sure if and what it gets set to.

Bill

Bill Gilligan

unread,
Apr 18, 2006, 12:28:09 AM4/18/06
to miva-...@googlegroups.com
Here is an example, and the result.... Doesn't seem right...

<MvCALL TIMEOUT="1" ACTION = "{'http://www.domain.com' }" METHOD = "post" FIELDS = "field1,field2
">

<MvEval expr="{ callvalue }">

</MvCall>


With a timeout of "1", it returns the headers and any result generated....
==================================

HTTP/1.1 200 OK Server: Microsoft-IIS/5.0 Date: Tue, 18 Apr 2006 04:24:37 GMT X-Powered-By: ASP.NET
Connection: Keep-Alive Content-Length: 902 Content-Type: text/xml Expires: Tue, 18 Apr 2006 04:24:35
GMT Cache-control: private Set-Cookie:
WT_ID=68.59.51.245-14762768.29778592::20A32AF82164CEE66AC2DFEDF72970F0; path=/; expires=Wed,
18-Apr-2007 04:24:37 GMT S3Y0011076 AND ALL THE NORMAL STUFF YOU WOULD EXPECT....

===============================
With a timeout of 100, generates just the normal stuff..


So - what is it I look for?
Evaling mvcall_error generates nothing.

Reply all
Reply to author
Forward
0 new messages