59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
global OPTS
if {[catch {read $chan} data]} {
#dputs "EOF $chan ([shortstr $data])"
incr OPTS(openports) -1
catch {close $chan}
return
}
#if {$data != ""} { dputs "got $chan ([shortstr $data])" }
if {[string match *CLOSE\n $data]} {
dputs "CLOSE $chan"
incr OPTS(openports) -1
close $chan
return
} elseif {[eof $chan]} {
# client gone or finished
|
|
|
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
global OPTS
if {[catch {read $chan} data]} {
#dputs "EOF $chan ([shortstr $data])"
incr OPTS(openports) -1
catch {close $chan}
return
}
#if {$data ne ""} { dputs "got $chan ([shortstr $data])" }
if {[string match *CLOSE\n $data]} {
dputs "CLOSE $chan"
incr OPTS(openports) -1
close $chan
return
} elseif {[eof $chan]} {
# client gone or finished
|