Obsolete
/
libipc-old
Archived
3
0
Fork 0
This repository has been archived on 2024-06-18. You can view files and clone it, but cannot push or open issues/pull-requests.
libipc-old/remote/script/testTcpd.sh

33 lines
627 B
Bash
Raw Normal View History

#!/bin/dash
REP=/tmp/ipc/
SERVICE="tcpd"
2016-10-06 19:44:53 +02:00
NB=10
if [ $# -ne 0 ]
then
NB=$1
fi
for pid in `seq 1 ${NB}`
do
# we make the application pipes
mkfifo ${REP}${pid}-1-1-in 2>/dev/null
mkfifo ${REP}${pid}-1-1-out 2>/dev/null
echo "connect 127.0.0.1 6000 ${pid} 1 1" > ${REP}${SERVICE}
# the purpose is to send something in the pipe
cat /dev/urandom | base64 | head -n 1 > ${REP}${pid}-1-1-out
# echo "hello world" > ${REP}${pid}-1-out
sleep 2
# the the service will answer with our message
echo "pid : ${pid}"
cat ${REP}/${pid}-1-1-in
2016-10-14 17:47:08 +02:00
echo "exit" > ${REP}${pid}-1-1-out
2016-10-03 17:30:52 +02:00
done