diff options
| author | Peter Stephenson <pws@users.sourceforge.net> | 2003-02-06 12:21:49 +0000 |
|---|---|---|
| committer | Peter Stephenson <pws@users.sourceforge.net> | 2003-02-06 12:21:49 +0000 |
| commit | 5c1f3b65a6f5abeae8459f41adb8fd2316971515 (patch) | |
| tree | 21a82daa1abab96c967d731c7afe2a3a2bd07fff /Functions/TCP/tcp_wait | |
| parent | 18191: from Greg Klanderman: compctl -y didn't respect list arrangement (diff) | |
| download | zsh-5c1f3b65a6f5abeae8459f41adb8fd2316971515.tar zsh-5c1f3b65a6f5abeae8459f41adb8fd2316971515.tar.gz zsh-5c1f3b65a6f5abeae8459f41adb8fd2316971515.tar.bz2 zsh-5c1f3b65a6f5abeae8459f41adb8fd2316971515.tar.lz zsh-5c1f3b65a6f5abeae8459f41adb8fd2316971515.tar.xz zsh-5c1f3b65a6f5abeae8459f41adb8fd2316971515.tar.zst zsh-5c1f3b65a6f5abeae8459f41adb8fd2316971515.zip | |
18202: New TCP function system plus small error message change in ztcp.
Diffstat (limited to 'Functions/TCP/tcp_wait')
| -rw-r--r-- | Functions/TCP/tcp_wait | 11 |
1 files changed, 11 insertions, 0 deletions
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 |
