Changeset 1221
- Timestamp:
- Nov 17, 2008 2:31:30 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/visviewer.tcl
r1220 r1221 23 23 24 24 private common servers_ ;# array of visualization server lists 25 set servers_(nanovis) " bilby.hubzero.org:2000"26 set servers_(pymol) " bilby.hubzero.org:2020"25 set servers_(nanovis) "" 26 set servers_(pymol) "" 27 27 28 28 private variable sid_ "" ;# socket connection to server 29 29 private common done_ ;# Used to indicate status of send. 30 30 private variable buffer_ ;# buffer for incoming/outgoing commands 31 31 32 # Number of milliseconds to wait before idle timeout. 32 #private variable idleTimeout_ 3600000 33 #private variable idleTimeout_ 0 34 private variable idleTimeout_ 5000 33 # If greater than 0, automatically disconnect from the visualization 34 # server when idle timeout is reached. 35 #private variable idleTimeout_ 3600000; # 1 hour 36 #private variable idleTimeout_ 5000; # 5 seconds 37 private variable idleTimeout_ 0; # No timeout 35 38 36 39 protected variable _dispatcher "" ;# dispatcher for !events … … 193 196 # Connect -- 194 197 # 195 # Connect to the visualization server (e.g. nanovis, pymolproxy). Send 196 # the server some estimate of the size of our job. If it's too busy, that 197 # server may forward us to another. 198 # Connect to the visualization server (e.g. nanovis, pymolproxy). 199 # Creates an event callback that is triggered when we are idle 200 # (no I/O with the server) for some specified time. Sends the server 201 # some estimate of the size of our job [soon to be deprecated]. 202 # If it's too busy, that server may forward us to another [this 203 # was been turned off in nanoscale]. 198 204 # 199 205 itcl::body Rappture::VisViewer::Connect { hostlist } { … … 223 229 fconfigure $sid_ -translation binary -encoding binary 224 230 225 # send memory requirement to the load balancer231 # Send memory requirement to the load balancer 226 232 puts -nonewline $sid_ [binary format I $memorySize] 227 233 flush $sid_ 228 234 229 # read back a reconnection order235 # Read back a reconnection order 230 236 set data [read $sid_ 4] 231 237 if {[binary scan $data cccc b1 b2 b3 b4] != 4} { … … 263 269 # 264 270 # Clients use this method to disconnect from the current rendering 265 # server. 271 # server. Cancel any pending idle timeout events. 266 272 # 267 273 itcl::body Rappture::VisViewer::Disconnect {} { 268 274 $_dispatcher cancel !timeout 269 275 if { [IsConnected] } { 270 catch {close $sid_} err276 catch {close $sid_} 271 277 set sid_ "" 272 278 } … … 286 292 # CheckConection -- 287 293 # 288 # Helper routine called from a file event to send data when the 289 # connection is writable (i.e. not blocked). Sets a magic 290 # variable done_($this) when we're done. 294 # This routine is called whenever we're about to send/recieve data on 295 # the socket connection to the visualization server. If we're connected, 296 # then reset the timeout event. Otherwise try to reconnect to the 297 # visualization server. 291 298 # 292 299 itcl::body Rappture::VisViewer::_CheckConnection {} { … … 514 521 # ReceiveEcho -- 515 522 # 516 # Echoes received data t zo clients interested in this widget. If the523 # Echoes received data to clients interested in this widget. If the 517 524 # -receivecommand option is set, then it is # invoked in the global 518 525 # scope with the <channel> and <data> values # as arguments. Otherwise,
Note: See TracChangeset
for help on using the changeset viewer.