Ignore:
Timestamp:
Feb 27, 2013 8:00:42 AM (11 years ago)
Author:
gah
Message:

add test fo ridiculous number of connect retries before failing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/scripts/visviewer.tcl

    r3371 r3372  
    4141    #private variable _idleTimeout 5000;    # 5 seconds
    4242    #private variable _idleTimeout 0;       # No timeout
     43    protected variable _maxConnects 100
    4344
    4445    private variable _logging 0
     
    4950    protected variable _image
    5051    protected variable _hostname
    51     protected variable _errorCount 0
     52    protected variable _numConnectTries 0
    5253    protected variable _debugConsole 0
    5354
     
    244245
    245246    puts stderr "server type is $_serverType"
     247    if { $_numConnectTries > $_maxConnects } {
     248        blt::busy release $itk_component(hull)
     249        set x [expr {[winfo rootx $itk_component(hull)]+10}]
     250        set y [expr {[winfo rooty $itk_component(hull)]+10}]
     251        Rappture::Tooltip::cue @$x,$y "Exceeded maximum number of connection attmepts to any $_serverType visualization server. Please contact support."
     252        return 0;
     253    }
    246254    foreach server [Shuffle $servers] {
    247255        puts stderr "connecting to $server..."
     
    252260            continue
    253261        }
     262        incr _numConnectTries
    254263        set _hostname $server
    255264        fconfigure $_sid -translation binary -encoding binary
     
    792801            button $inner.ok -text "Dismiss" -command [list $popup deactivate] \
    793802                -font "Arial 9"
    794             incr _errorCount
    795803            blt::table $inner \
    796804                0,0 $inner.scrl -fill both \
Note: See TracChangeset for help on using the changeset viewer.