#!/bin/bash

if [ $# -lt 2 ]; then
	echo Usage: $0 port slowserverport
	exit 1
fi

PORT=$1
LPORT=$2
WGETOPT="-q -O -"

wget $WGETOPT http://localhost:$PORT/startSession/key1
wget $WGETOPT http://localhost:$PORT/remoteGetFile/localhost:$LPORT/snail &
wget $WGETOPT http://localhost:$PORT/remoteGetFile/localhost:$LPORT/fast &
wget $WGETOPT http://localhost:$PORT/remoteGetFile/localhost:$LPORT/fast &
wget $WGETOPT http://localhost:$PORT/remoteGetFile/localhost:$LPORT/fast &
wget $WGETOPT http://localhost:$PORT/remoteGetFile/localhost:$LPORT/fast &
wget $WGETOPT http://localhost:$PORT/remoteGetFile/localhost:$LPORT/fast &
wget $WGETOPT http://localhost:$PORT/remoteGetFile/localhost:$LPORT/turtle &
wget $WGETOPT http://localhost:$PORT/remoteGetFile/localhost:$LPORT/fast &
wget $WGETOPT http://localhost:$PORT/remoteGetFile/localhost:$LPORT/fast &
wget $WGETOPT http://localhost:$PORT/remoteGetFile/localhost:$LPORT/fast &
wget $WGETOPT http://localhost:$PORT/remoteGetFile/localhost:$LPORT/fast &
wget $WGETOPT http://localhost:$PORT/remoteGetFile/localhost:$LPORT/fast &
wget $WGETOPT http://localhost:$PORT/remoteGetFile/localhost:$LPORT/slug &
wget $WGETOPT http://localhost:$PORT/remoteGetFile/localhost:$LPORT/fast &
wget $WGETOPT http://localhost:$PORT/remoteGetFile/localhost:$LPORT/fast &
wget $WGETOPT http://localhost:$PORT/remoteGetFile/localhost:$LPORT/fast &
wget $WGETOPT http://localhost:$PORT/remoteGetFile/localhost:$LPORT/fast &
wget $WGETOPT http://localhost:$PORT/remoteGetFile/localhost:$LPORT/fast &
wget $WGETOPT http://localhost:$PORT/remoteGetFile/localhost:$LPORT/snail &
wget $WGETOPT http://localhost:$PORT/remoteGetFile/localhost:$LPORT/fast &
wget $WGETOPT http://localhost:$PORT/remoteGetFile/localhost:$LPORT/fast &
wget $WGETOPT http://localhost:$PORT/remoteGetFile/localhost:$LPORT/fast &
wget $WGETOPT http://localhost:$PORT/remoteGetFile/localhost:$LPORT/fast &
wget $WGETOPT http://localhost:$PORT/remoteGetFile/localhost:$LPORT/fast &
wait
echo
wget $WGETOPT http://localhost:$PORT/endSession/key1/mylog 
echo
wget $WGETOPT http://localhost:$PORT/summary/mylog




