Artifact
767c571f32b3ec993ca0eaa004129c915397e4f4f44e36f2a4d7894eee1445c5:
Attachment "client-torncrlf.tcl" to
ticket [b3977d199b]
added by
apnadkarni
2022-07-03 06:27:49.
0000: 69 66 20 7b 31 7d 20 7b 0d 0a 20 20 20 20 73 65 if {1} {.. se
0010: 74 20 63 68 61 6e 20 5b 73 6f 63 6b 65 74 20 31 t chan [socket 1
0020: 32 37 2e 30 2e 30 2e 31 20 31 30 30 30 30 5d 0d 27.0.0.1 10000].
0030: 0a 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 20 73 .} else {.. s
0040: 65 74 20 63 68 61 6e 20 73 74 64 69 6e 0d 0a 7d et chan stdin..}
0050: 0d 0a 66 69 6c 65 65 76 65 6e 74 20 24 63 68 61 ..fileevent $cha
0060: 6e 20 72 65 61 64 61 62 6c 65 20 7b 0d 0a 20 20 n readable {..
0070: 20 20 69 66 20 7b 5b 67 65 74 73 20 24 63 68 61 if {[gets $cha
0080: 6e 20 6c 69 6e 65 5d 20 3e 3d 20 30 7d 20 7b 0d n line] >= 0} {.
0090: 0a 20 20 20 20 20 20 20 20 70 75 74 73 20 3c 24 . puts <$
00a0: 6c 69 6e 65 3e 0d 0a 20 20 20 20 7d 20 65 6c 73 line>.. } els
00b0: 65 69 66 20 7b 5b 65 6f 66 20 24 63 68 61 6e 5d eif {[eof $chan]
00c0: 7d 20 7b 0d 0a 20 20 20 20 20 20 20 20 73 65 74 } {.. set
00d0: 20 64 6f 6e 65 20 31 0d 0a 20 20 20 20 7d 0d 0a done 1.. }..
00e0: 7d 0d 0a 66 63 6f 6e 66 69 67 75 72 65 20 24 63 }..fconfigure $c
00f0: 68 61 6e 20 2d 62 6c 6f 63 6b 69 6e 67 20 30 20 han -blocking 0
0100: 2d 62 75 66 66 65 72 69 6e 67 20 6c 69 6e 65 0d -buffering line.
0110: 0a 76 77 61 69 74 20 64 6f 6e 65 0d 0a .vwait done..