Re: Time out operation



On Jan 30, 6:47 pm, Chendu <pjsent...@xxxxxxxxx> wrote:
On Jan 29, 11:16 pm, Pascal <pas...@xxxxxxxxx> wrote:





Chendu a écrit :

Case : I have to retrieve data from different servers.

I have to fetch the data from different servers, I am able to do this
in sequence.
Now problem is suppose one server is down, the script is hanging.
I wanted to include a time out option where in it tries for period of
time. if its timed out, It should continue and go to retrieve the data
from other servers.

How can i do this in TCL. There is not time out option.
time command is there, i dont think i can make use of it.
Can some one give suggestion for this.

Thanks
Senthilvelu

usage : vwaitTimed ::myvar 3000 (will timeout after 3 sec), and I
suppose ::mywar is set by server #n

###########################################################################­­#####
# vwait but will timeout after a delay. Var must be fully qualified (::)
###########################################################################­­#####
proc vwaitTimed { var {delay 0} {warn "warnuser"} } {

   proc trigger {var warn} {
     if {$warn == "warnuser"} {
       tk_messageBox -type ok -icon error -parent . -title "Protocol
error" -message "vwait timeout for $var"
     }
     set $var 1
   }

   if { $delay != 0 } {
     set timerId [after $delay "trigger $var $warn"]
   }

   vwait $var

   if [info exists timerId] { after cancel $timerId }

}

Pascal- Hide quoted text -

- Show quoted text -

I am using a external command to get the data from the server.- Hide quoted text -

- Show quoted text -


variable data // this is global
set ser { list of server}

foreach serverName $ser {
set data [getDatafrom $serverName]
}

Whats happening is when the server is down whole script is hanging. It
is now trying to get data from other servers

Now, how can i use vWaitTimed procedure . should the getDatafrom
should be passed as argument in place on var.
what the vwait does.

Senthil
.



Relevant Pages

  • Re: Same Internal Server Error from last two days
    ... I am trying to run a Hello World Perl Script in Apache 2.2. ... But its constantly giving me Internal Server Error.The script ... # have to place corresponding `LoadModule' lines at this location so the ...
    (perl.beginners)
  • Re: Same Internal Server Error from last two days
    ... I am trying to run a Hello World Perl Script in Apache 2.2. ... But its constantly giving me Internal Server Error.The script Runs perfectly fine from the command prompt. ... # This is the main Apache HTTP server configuration file. ... LoadModule actions_module modules/mod_actions.so ...
    (perl.beginners)
  • Same Internal Server Error from last two days
    ... I am trying to run a Hello World Perl Script in Apache 2.2. ... But its constantly giving me Internal Server Error.The script ... # have to place corresponding `LoadModule' lines at this location so the ...
    (perl.beginners)
  • Re: Regarding a selection for mobile code/scripting language
    ... Client Side scripting, so the server can send script commands to the client. ... I decided they should be scripted and mobile code. ...
    (Vuln-Dev)
  • Re: HTTPSConnection script fails, but only on some servers (long)
    ... (HTTP/CONNECT + switch to HTTPS) ... wget and my python script. ... >>The python script works with server A, ... the problem seems to depend on both the client ...
    (comp.lang.python)