<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
I'm such a birdbrain,<br>
adjust-timeout! has to be in the function given to send/supend of
course!<br>
Thanks anyway!<br>
<br>
<br>
<br>
Hans Oesterholt-Dijkema schreef:
<blockquote cite="mid:4684BC8E.8050802@gawab.com" type="cite">
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
I added some extra debug information.<br>
<br>
I changed the example add.ss with an extra adjust-timeout!:<br>
<br>
<tt>(require (lib "unitsig.ss")<br>
(lib "servlet-sig.ss" "web-server")<br>
(lib "date.ss"))<br>
<br>
(unit/sig () (import servlet^)<br>
<br>
; request-number : str -> num<br>
(define (request-number which-number)<br>
(string->number<br>
(extract-binding/single<br>
'number<br>
(request-bindings (send/suspend (build-request-page
which-number))))))<br>
<br>
; build-request-page : str -> str -> response<br>
(define (build-request-page which-number)<br>
(lambda (k-url)<br>
`(html (head (title "Enter a Number to Add"))<br>
(body ([bgcolor "white"])<br>
(form ([action ,k-url] [method "post"])<br>
"Enter the " ,which-number " number to add: "<br>
(input ([type "text"] [name "number"] [value
""]))<br>
(input ([type "submit"] [name "enter"] [value
"Enter"])))))))<br>
<br>
(adjust-timeout! 30)<br>
<br>
`(html (head (title "Sum"))<br>
(body ([bgcolor "white"])<br>
(p "The sum is "<br>
,(number->string (+ (request-number "first")
(request-number "second")))))))<br>
</tt><br>
Well, this is the logging I get. The adjust-timeout! value is set to
30. Next. I see a timer added with id 1.<br>
This timer with id 1 is updated serveral times (different values?) <br>
<br>
Next I see a timer added with id=2 and id=3. These are expired within 1
second. The add servlets post action gets<br>
invalidated and is removed. I'd want to change the value of
send/suspend. But this seems to be related to the<br>
'default-servlet-timeout' value? But what about this 'adjust-timeout!'?<br>
<br>
<tt>revise-timer: 1:id:#f 1183103685178.0 1183103654178.0 31000
#<procedure:provide/contract-field-contract-action-timer><br>
Add timer: ID=0<br>
revise-timer: 2:id:0 1183103685178.0 1183103654178.0 31000
#<procedure:provide/contract-field-contract-action-timer><br>
revise-timer: 1:id:0 1183103685178.0 1183103654258.0 86400000
#<procedure:provide/contract-field-contract-action-timer><br>
revise-timer: 2:id:0 1183190054258.0 1183103654258.0 86400000
#<procedure:provide/contract-field-contract-action-timer><br>
revise-timer: 1:id:#f 1183190054328.0 1183103654328.0 172800000.0
#<procedure:provide/contract-field-contract-action-timer><br>
1<br>
<font color="#3333ff">adjust-timeout! 1 30</font><br>
revise-timer: 1:id:#f 1183190054328.0 1183103654328.0 172800000.0
#<procedure:provide/contract-field-contract-action-timer><br>
<font color="#3333ff"><b>revise-timer: 1:id:#f 1183190054328.0
1183103654328.0 30000
#<procedure:provide/contract-field-contract-action-timer></b></font><br>
<font color="#3333ff">Add timer: ID=1</font><br>
revise-timer: 2:id:1 1183276454328.0 1183103654328.0 172800000.0
#<procedure:provide/contract-field-contract-action-timer><br>
revise-timer: 1:id:1 1183276454328.0 1183103654328.0 259200000.0
#<procedure:provide/contract-field-contract-action-timer><br>
revise-timer: 2:id:1 1183276454328.0 1183103654328.0 172800000.0
#<procedure:provide/contract-field-contract-action-timer><br>
<font color="#3333ff">revise-timer: 2:id:1 1183103684328.0
1183103654328.0 30000
#<procedure:provide/contract-field-contract-action-timer></font><br>
revise-timer: 2:id:1 1183362854328.0 1183103654328.0 259200000.0
#<procedure:provide/contract-field-contract-action-timer><br>
<font color="#3333ff">Add timer: ID=2<br>
ALARM!: id:2 1183103655328.0 1183103655329.0<br>
Add timer: ID=3<br>
ALARM!: id:3 1183103655329.0 1183103655339.0</font><br>
revise-timer: 1:id:0 1183190054258.0 1183103660988.0 31000
#<procedure:provide/contract-field-contract-action-timer><br>
revise-timer: 1:id:0 1183190054258.0 1183103660988.0 86400000
#<procedure:provide/contract-field-contract-action-timer><br>
revise-timer: 2:id:0 1183103691988.0 1183103660988.0 31000
#<procedure:provide/contract-field-contract-action-timer><br>
revise-timer: 2:id:0 1183190060988.0 1183103660988.0 86400000
#<procedure:provide/contract-field-contract-action-timer><br>
revise-timer: 1:id:1 1183362854328.0 1183103660998.0 345593330.0
#<procedure:provide/contract-field-contract-action-timer><br>
revise-timer: 2:id:1 1183449254328.0 1183103660998.0 345593330.0
#<procedure:provide/contract-field-contract-action-timer><br>
revise-timer: 1:id:1 1183449254328.0 1183103660998.0 431993330.0
#<procedure:provide/contract-field-contract-action-timer><br>
revise-timer: 1:id:1 1183449254328.0 1183103660998.0 431993330.0
#<procedure:provide/contract-field-contract-action-timer><br>
revise-timer: 2:id:1 1183535654328.0 1183103660998.0 431993330.0
#<procedure:provide/contract-field-contract-action-timer><br>
revise-timer: 2:id:1 1183535654328.0 1183103660998.0 431993330.0
#<procedure:provide/contract-field-contract-action-timer><br>
revise-timer: 1:id:3 1183103655329.0 1183103660998.0 -4669.0
#<procedure:provide/contract-field-contract-action-timer><br>
revise-timer: 2:id:3 1183103656329.0 1183103660998.0 -4669.0
#<procedure:provide/contract-field-contract-action-timer><br>
revise-timer: 1:id:1 1183535654328.0 1183103660998.0 518393330.0
#<procedure:provide/contract-field-contract-action-timer><br>
revise-timer: 2:id:1 1183622054328.0 1183103660998.0 518393330.0
#<procedure:provide/contract-field-contract-action-timer><br>
<br>
</tt><br>
Hans Oesterholt-Dijkema schreef:
<blockquote cite="mid:46844647.7090204@gawab.com" type="cite">
<meta content="text/html;charset=ISO-8859-1"
http-equiv="Content-Type">
What I actually see, is the initial-connect-timeout value reset my
servlet.<br>
It times out and resets my servlet.<br>
<br>
Am I doing something wrong in my servlet code?<br>
<br>
--Hans<br>
<tt><br>
(define (hwiki-start request set-timeout)<br>
<br>
(if INSTALL-PLUGINS<br>
(begin<br>
(debug "Installing plugins")<br>
(let ((f (dynamic-require "hwiki-plugins.scm"
'install-plugins)))<br>
(debug (format "dynamic require of
'hwiki-plugins.scm' results in ~a" f))<br>
(f)<br>
(set! INSTALL-PLUGINS #f))))<br>
<br>
(debug "START" (url->string (request-uri request)))<br>
(let ((context (get-context request)))<br>
<br>
(set-timeout context)<br>
<br>
(let ((P (page context)))<br>
(let ((function (if (or (-> P special?) (-> context
logged-in?))<br>
send/suspend<br>
send/forward)))<br>
(if (not (-> P special?))<br>
(-> context from-where (-> context
page-name)))<br>
(debug "special?" (-> P special?) " function: "
function " context:" (-> context context))<br>
(let ((R (-> P create-html)))<br>
(debug "calling " R)<br>
(let ((B (function R)))<br>
(debug "RESTART" R function B)<br>
(hwiki-start B set-timeout)))))))<br>
</tt><br>
<br>
Hans Oesterholt-Dijkema schreef:
<blockquote cite="mid:468441A2.6020401@gawab.com" type="cite">
<meta content="text/html;charset=ISO-8859-1"
http-equiv="Content-Type">
The timeout occurs every 30 seconds. As configured in the configuration
file:<br>
<br>
(default-servlet-timeout 30) <br>
<br>
?<br>
<br>
I see "revise-timer" gets called after my servlet has been run with a
value<br>
of 30. Also, within a send/suspend situation. My web server config is
set<br>
to 3600 seconds, so I won't notice much over there. But I want to
shorten<br>
the servlet existence to let's say 120 seconds and when doing edit
session<br>
set it to like 3 hours.<br>
<br>
How does it work?<br>
<br>
--Hans<br>
<br>
<br>
Hans Oesterholt-Dijkema schreef:
<blockquote cite="mid:468432F2.3000402@gawab.com" type="cite">
<meta content="text/html;charset=ISO-8859-1"
http-equiv="Content-Type">
How, wait. I get this message:<br>
<br>
<a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://localhost/servlets;4*1*1739593/hwiki.scm/special:edit.html?context=">http://localhost/servlets;4*1*1739593/hwiki.scm/special:edit.html?context=</a><br>
<h1>Not Found</h1>
<p>Couldn't find what you were looking for. Sorry.</p>
Also when I set the initial value of the timeout to 120 or 1200. <br>
After about just as much time.<br>
<br>
Any ideas?<br>
<br>
--Hans<br>
<br>
<br>
Hans Oesterholt-Dijkema schreef:
<blockquote cite="mid:46842F24.9050805@gawab.com" type="cite">Dear
Jay, <br>
<br>
Thanks for the answer. I've seen the code. adjust-timeout! is called <br>
with the timeout value of the servlet just before the servlet is
started. <br>
<br>
However, when I call adjust-timeout! from the servlet itself, somehow, <br>
it doesn't work. Suppose I put the value to * 3 3600 (3 hours), I still
<br>
get an expiration after the initial 120 seconds (or maybe even faster).
<br>
<br>
I'm debugging your 360 code (just getting to revise-timer), but I'm <br>
still not seeing why it doesn't work. <br>
<br>
What could be wrong? <br>
<br>
--Hans <br>
<br>
<br>
Jay McCarthy schreef: <br>
<blockquote type="cite">adjust-timeout! does not change the
timeout
variable. It communicates <br>
an update to the internal timeout counter. The timeout variable should <br>
really have been named 'initial-timeout', but it is too late. <br>
<br>
Jay <br>
<br>
On 6/28/07, Hans Oesterholt-Dijkema <a moz-do-not-send="true"
class="moz-txt-link-rfc2396E" href="mailto:hdnews@gawab.com"><hdnews@gawab.com></a>
wrote: <br>
<blockquote type="cite">Hi there, <br>
<br>
I'm trying to use adjust-timeout! to control the timeout <br>
behaviour of a module type servlet in the mzscheme <br>
web-server. <br>
<br>
However, adjust-timeout! doesn't seem to be working. <br>
Whatever I use as a value. The value of the timeout variable <br>
stays the same. <br>
<br>
What should I do to make this work? <br>
<br>
--hans <br>
<br>
_________________________________________________ <br>
For list-related administrative tasks: <br>
<a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme">http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a>
<br>
<br>
</blockquote>
<br>
<br>
</blockquote>
_________________________________________________ <br>
For list-related administrative tasks: <br>
<a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme">http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a>
<br>
<br>
<br>
</blockquote>
<pre wrap=""><hr size="4" width="90%">
_________________________________________________
For list-related administrative tasks:
<a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme">http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a>
</pre>
</blockquote>
<pre wrap=""><hr size="4" width="90%">
_________________________________________________
For list-related administrative tasks:
<a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme">http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a>
</pre>
</blockquote>
<pre wrap=""><hr size="4" width="90%">
_________________________________________________
For list-related administrative tasks:
<a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme">http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a>
</pre>
</blockquote>
<pre wrap="">
<hr size="4" width="90%">
_________________________________________________
For list-related administrative tasks:
<a class="moz-txt-link-freetext" href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme">http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a>
</pre>
</blockquote>
</body>
</html>