while infinite loop_sockets constant

Hello Every one,

it's requiered to create 'n' number of sockets constant for a hour time. i had my own script to create sockets using this i was able to create sockets and sendind data but using the tool i can maintain 'n' number of sockets for 5 minutes only after sockets are getting reduced to 0 here i have used while infinite loop with sleep 300 seconds this time i have observed more scokets than 'n'( i need 'n' number of sockets for an hour and this number should be same it should not vary).

i am using the following script

while :

do

{code to crete sockets}

sleep 300

done

in the above code for first 5 minutes i was able to create 'n' number of sockets after that sockets number is getting reduced one by one and finally reaching to zero here i am using infinite loop which will run for every 5 minutes as i already stated after 5 minutes number of sockets reducing to n-1,n-2 ................0 in the above infinite loop after 5 minutes number of sockets are n+n-1..............but i need number of sockets are always n.

can somebody help me out here ,if the problem is not clear pls let me know.

kind regards,
Srinu

I am not very clear about your issue.

Anyway for infinite while loop, use the below syntax

while [ 1 ]
do
{code to create sockets}
n=`expr $n - 1` #-- if needed to reduce the value of "n"
sleep 300
continue
done

--Jayan Jayaseelan