Re: Time out operation



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.
.



Relevant Pages

  • Re: switching between stylesheets
    ... left them hanging. ... I removed that code and found this script in a ...
    (comp.lang.javascript)
  • Re: High vmstat, filesystem unresponsive then hang 6.1 Stable
    ... This is the same issue that I've been hitting, and that requires the serial console / DDB stuff described in the debugging deadlocks web page that I pointed you at ... ... So far *knock on wood* since adding all of the debugging to one of my server, none of mine have done it ... ... UID PID PPID CPU PRI NI VSZ RSS MWCHAN STAT TT TIME COMMAND ... master (nfsd) ...
    (freebsd-stable)
  • Re: switching between stylesheets
    ... left them hanging. ... I removed that code and found this script in a ...
    (comp.lang.javascript)
  • Re: Time out operation
    ... Now problem is suppose one server is down, ... set data [getDatafrom $serverName] ... Whats happening is when the server is down whole script is hanging. ...
    (comp.lang.tcl)
  • unknown slowdown
    ... In my wardrobe I have my noisy/fast server, to which I can connect via ... USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND ... vinum daemon ...
    (freebsd-questions)