Changeset 783


Ignore:
Timestamp:
Jul 19, 2007 5:20:11 AM (14 years ago)
Author:
mmc
Message:

Fix for ticket #3169 (error writing "sock66": connection reset by peer)
Added some code to guard against errors when writing to the socket
connection.

File:
1 edited

Legend:

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

    r767 r783  
    761761            set h [winfo height $itk_component(3dview)]
    762762
    763             puts $_sid "screen $w $h"
    764             _send_echo >>line "screen $w $h"
    765 
    766             set _view(theta) 45
    767             set _view(phi) 45
    768             set _view(psi) 0
    769             set _view(zoom) 1.0
    770             after idle [itcl::code $this _rebuild]
    771             Rappture::Tooltip::cue hide
     763            if {[catch {puts $_sid "screen $w $h"}]} {
     764                disconnect
     765                _receive_echo closed
     766                $_dispatcher event -after 750 !serverDown
     767            } else {
     768                _send_echo >>line "screen $w $h"
     769
     770                set _view(theta) 45
     771                set _view(phi) 45
     772                set _view(psi) 0
     773                set _view(zoom) 1.0
     774                after idle [itcl::code $this _rebuild]
     775                Rappture::Tooltip::cue hide
     776            }
    772777            return
    773778        }
     
    780785            append _buffer(out) $string "\n"
    781786        } else {
    782             puts $_sid $string
    783             foreach line [split $string \n] {
    784                 _send_echo >>line $line
     787            if {[catch {puts $_sid $string}]} {
     788                disconnect
     789                _receive_echo closed
     790                $_dispatcher event -after 750 !serverDown
     791            } else {
     792                foreach line [split $string \n] {
     793                    _send_echo >>line $line
     794                }
    785795            }
    786796        }
Note: See TracChangeset for help on using the changeset viewer.