<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
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>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (lib "servlet-sig.ss" "web-server")<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (lib "date.ss"))<br>
<br>
(unit/sig () (import servlet^)<br>
<br>
&nbsp; ; request-number : str -&gt; num<br>
&nbsp; (define (request-number which-number)<br>
&nbsp;&nbsp;&nbsp; (string-&gt;number<br>
&nbsp;&nbsp;&nbsp;&nbsp; (extract-binding/single<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'number<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (request-bindings (send/suspend (build-request-page
which-number))))))<br>
<br>
&nbsp; ; build-request-page : str -&gt; str -&gt; response<br>
&nbsp; (define (build-request-page which-number)<br>
&nbsp;&nbsp;&nbsp; (lambda (k-url)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; `(html (head (title "Enter a Number to Add"))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (body ([bgcolor "white"])<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (form ([action ,k-url] [method "post"])<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "Enter the " ,which-number " number to add: "<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (input ([type "text"] [name "number"] [value
""]))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (input ([type "submit"] [name "enter"] [value
"Enter"])))))))<br>
<br>
&nbsp;&nbsp; (adjust-timeout! 30)<br>
<br>
&nbsp; `(html (head (title "Sum"))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (body ([bgcolor "white"])<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (p "The sum is "<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ,(number-&gt;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
#&lt;procedure:provide/contract-field-contract-action-timer&gt;<br>
Add timer: ID=0<br>
revise-timer: 2:id:0 1183103685178.0 1183103654178.0 31000
#&lt;procedure:provide/contract-field-contract-action-timer&gt;<br>
revise-timer: 1:id:0 1183103685178.0 1183103654258.0 86400000
#&lt;procedure:provide/contract-field-contract-action-timer&gt;<br>
revise-timer: 2:id:0 1183190054258.0 1183103654258.0 86400000
#&lt;procedure:provide/contract-field-contract-action-timer&gt;<br>
revise-timer: 1:id:#f 1183190054328.0 1183103654328.0 172800000.0
#&lt;procedure:provide/contract-field-contract-action-timer&gt;<br>
1<br>
<font color="#3333ff">adjust-timeout! 1 30</font><br>
revise-timer: 1:id:#f 1183190054328.0 1183103654328.0 172800000.0
#&lt;procedure:provide/contract-field-contract-action-timer&gt;<br>
<font color="#3333ff"><b>revise-timer: 1:id:#f 1183190054328.0
1183103654328.0 30000
#&lt;procedure:provide/contract-field-contract-action-timer&gt;</b></font><br>
<font color="#3333ff">Add timer: ID=1</font><br>
revise-timer: 2:id:1 1183276454328.0 1183103654328.0 172800000.0
#&lt;procedure:provide/contract-field-contract-action-timer&gt;<br>
revise-timer: 1:id:1 1183276454328.0 1183103654328.0 259200000.0
#&lt;procedure:provide/contract-field-contract-action-timer&gt;<br>
revise-timer: 2:id:1 1183276454328.0 1183103654328.0 172800000.0
#&lt;procedure:provide/contract-field-contract-action-timer&gt;<br>
<font color="#3333ff">revise-timer: 2:id:1 1183103684328.0
1183103654328.0 30000
#&lt;procedure:provide/contract-field-contract-action-timer&gt;</font><br>
revise-timer: 2:id:1 1183362854328.0 1183103654328.0 259200000.0
#&lt;procedure:provide/contract-field-contract-action-timer&gt;<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
#&lt;procedure:provide/contract-field-contract-action-timer&gt;<br>
revise-timer: 1:id:0 1183190054258.0 1183103660988.0 86400000
#&lt;procedure:provide/contract-field-contract-action-timer&gt;<br>
revise-timer: 2:id:0 1183103691988.0 1183103660988.0 31000
#&lt;procedure:provide/contract-field-contract-action-timer&gt;<br>
revise-timer: 2:id:0 1183190060988.0 1183103660988.0 86400000
#&lt;procedure:provide/contract-field-contract-action-timer&gt;<br>
revise-timer: 1:id:1 1183362854328.0 1183103660998.0 345593330.0
#&lt;procedure:provide/contract-field-contract-action-timer&gt;<br>
revise-timer: 2:id:1 1183449254328.0 1183103660998.0 345593330.0
#&lt;procedure:provide/contract-field-contract-action-timer&gt;<br>
revise-timer: 1:id:1 1183449254328.0 1183103660998.0 431993330.0
#&lt;procedure:provide/contract-field-contract-action-timer&gt;<br>
revise-timer: 1:id:1 1183449254328.0 1183103660998.0 431993330.0
#&lt;procedure:provide/contract-field-contract-action-timer&gt;<br>
revise-timer: 2:id:1 1183535654328.0 1183103660998.0 431993330.0
#&lt;procedure:provide/contract-field-contract-action-timer&gt;<br>
revise-timer: 2:id:1 1183535654328.0 1183103660998.0 431993330.0
#&lt;procedure:provide/contract-field-contract-action-timer&gt;<br>
revise-timer: 1:id:3 1183103655329.0 1183103660998.0 -4669.0
#&lt;procedure:provide/contract-field-contract-action-timer&gt;<br>
revise-timer: 2:id:3 1183103656329.0 1183103660998.0 -4669.0
#&lt;procedure:provide/contract-field-contract-action-timer&gt;<br>
revise-timer: 1:id:1 1183535654328.0 1183103660998.0 518393330.0
#&lt;procedure:provide/contract-field-contract-action-timer&gt;<br>
revise-timer: 2:id:1 1183622054328.0 1183103660998.0 518393330.0
#&lt;procedure:provide/contract-field-contract-action-timer&gt;<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>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (define (hwiki-start request set-timeout)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (if INSTALL-PLUGINS<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (begin<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (debug "Installing plugins")<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (let ((f (dynamic-require "hwiki-plugins.scm"
'install-plugins)))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (debug (format "dynamic require of
'hwiki-plugins.scm' results in ~a" f))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (f)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (set! INSTALL-PLUGINS #f))))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (debug "START" (url-&gt;string (request-uri request)))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (let ((context (get-context request)))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (set-timeout context)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (let ((P (page context)))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (let ((function (if (or (-&gt; P special?) (-&gt; context
logged-in?))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; send/suspend<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; send/forward)))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (if (not (-&gt; P special?))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (-&gt; context from-where (-&gt; context
page-name)))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (debug "special?" (-&gt; P special?) " function: "
function " context:" (-&gt; context context))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (let ((R (-&gt; P create-html)))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (debug "calling " R)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (let ((B (function R)))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (debug "RESTART" R function B)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (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.&nbsp; 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">&lt;hdnews@gawab.com&gt;</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>
&nbsp; For list-related administrative tasks: <br>
&nbsp; <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>
&nbsp;For list-related administrative tasks: <br>
&nbsp;<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 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>