From 5c1f3b65a6f5abeae8459f41adb8fd2316971515 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 6 Feb 2003 12:21:49 +0000 Subject: 18202: New TCP function system plus small error message change in ztcp. --- Functions/TCP/tcp_wait | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Functions/TCP/tcp_wait (limited to 'Functions/TCP/tcp_wait') diff --git a/Functions/TCP/tcp_wait b/Functions/TCP/tcp_wait new file mode 100644 index 000000000..d18068a66 --- /dev/null +++ b/Functions/TCP/tcp_wait @@ -0,0 +1,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 -- cgit v1.2.3