if an on sockclose event takes a long time to execute, it will be called twice, possibly leading to errors when the event isn't designed to run twice in a row.
alias test sockopen test www.yahoo.com 80
sockwrite -tn test GET / HTTP/1.0
sockwrite -t test $str($crlf, 2)
alias -l TestAsk echo 4 -a $?
The use of an alias to use $? is just to make a short, easy-to-understand example.