set numcon 50
set goodsockets 0
set badsockets 0

set i 0
while { $i < $numcon } {
    if { [catch {
	    set sk [socket localhost 8090] 
	    fconfigure $sk -buffering line 
	    puts $sk {GET / HTTP/1.0} 
	} err] } {
	    incr ::badsockets 
	    puts "$::badsockets bad sockets" 
    } else { 
	incr ::goodsockets 
	puts "$::goodsockets good sockets" 
    }
    incr i 
} 
