summary refs log tree commit diff
path: root/Functions/TCP/tcp_wait
blob: d18068a66368eddc90316b8c9115662184b0983c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
# Wait for given number of seconds, reading any data from
# all TCP connections while doing so.

typeset -F SECONDS to end

(( to = $1, end = SECONDS + to ))
while (( SECONDS < end )); do
  tcp_read -a -T $to
  (( to = end - SECONDS ))
done
return