Tcl Source Code

Artifact [cb0c75022a]
Login

Artifact cb0c75022a9a87e034ba8c253ba5828ff0cb4f91:

Attachment "219400.client" to ticket [219400ffff] added by andreas_kupries 2001-09-08 02:03:53.
# -*- tcl -*-
# Client for Tcl bug 219400

set addr [lindex $argv 0] 

## called when data from remote end arrives. 
proc cb {} { 
    variable sock 

    read $sock 

    puts $sock "<callback firstsend>" 
    puts $sock "<callback secondsend>" 

    for {set i 0} {$i < 9000} {incr i} { 
	puts $sock "test32432 test3211 $i" 
    }

    puts $sock "<callback lastnormalsend>" 
    puts $sock "all data ok" 

    close $sock 
    exit 
}

## Open & configure 
variable sock [socket $addr 40010] 
fconfigure $sock -blocking 0 
fconfigure $sock -buffering none 

fileevent $sock r cb 
# cb 

puts $sock "start" 
vwait forever