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
on *:sockopen:test:{
sockwrite -tn test GET / HTTP/1.0
sockwrite -t test $str($crlf, 2)
}
on *:sockclose:test:{
TestAsk
}
alias -l TestAsk echo 4 -a $?The use of an alias to use $? is just to make a short, easy-to-understand example.