for {set i 0} {$i < 5} {incr i} { set sock [socket 127.0.0.1 53210] gets $sock line puts $line gets $sock line puts $line close $sock after 500 }