TCP
non-AIX:
decaf port program arguments
AIX:
: bsh or ksh
# inline decaffienation
finish () {
# your handler here
}
read fd < /dev/tcp || finish "/dev/tcp driver error"
echo $fd $Port > /dev/tcp || finish "$Port inaccessible"
while :
do
(read afd clienthost clientport <&$fd && \
(program arguments <&$afd >&$afd &))
wait
done
Networking types will recognize that decaf does almost exactly what inetd is supposed to do. Decaf is therefore simply a good developmental alternative to messing with /etc/services. If you're on AIX4.x and can install the TCP driver, use the script instead: it's equally efficient, but more robust, and is a more detailed source reference anyway. Given the inetd and the inline alternatives, I don't feel compelled at the moment to incorporate the proper waiting behavior into decaf. If you do, please yell.
| 1.0 | 14.7.97 | First cut server. Does not do wait(). |
[ Research home page | IBM home page | Search | ContactIBM | Legal | Author ]