forked from papagryllos-productions/threading-pizza
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
client_sc script added & some extra debugging to the client.c
-details on how to use script includes inside the file
- Loading branch information
Showing
2 changed files
with
42 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# this is a script that enables the user to make | ||
# multiple client requests to the server | ||
# argument 1 specifies how many times the client program | ||
# is going to execute | ||
# argument 2 is specifies the name of the executable | ||
# if no arguments are giver default values are : | ||
# executable = client | ||
# number of repetitions : 100 | ||
|
||
if [ $1 ]; then | ||
n=$1; | ||
else | ||
n=100; | ||
fi | ||
if [[ -x $2 ]]; then | ||
|
||
for ((i=1;i<=n;i++)) | ||
do | ||
./$2 rand # call the client as specified by second argument | ||
sleep 0.2 # just a little delay in order | ||
# to have the rand function generate | ||
# different orders | ||
done | ||
else | ||
if [[ -x client ]]; then | ||
|
||
for ((i=1;i<=n;i++)) | ||
do | ||
./client rand # call the client as default | ||
sleep 0.2 # just a little delay in order | ||
# to have the rand function generate | ||
# different orders | ||
done | ||
else | ||
echo "specify the name of the executable"; | ||
fi | ||
|
||
fi |