Sponsored Content
Top Forums Shell Programming and Scripting while infinite loop_sockets constant Post 302323007 by mannam srinivas on Friday 5th of June 2009 05:46:11 AM
Old 06-05-2009
MySQL 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
 

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Constant mirroring

I'm not sure how to best explain what I'd like to do, so let me give an example. I used to work in a department that deals with internet security. This department had an "internal" website (only people in the building can get on it) and an "external" website (anyone in the world can get on it --... (1 Reply)
Discussion started by: sstevens
1 Replies

2. Programming

Is my code in an Infinite Loop?

Production C code compiled without the dash-g option is running, and seems to be in an infinite loop. Is there a way to tell? Is there a diagnostic tool that will report what objects or what lines of code or even what functions are being executed? Or is my best option to kill it with a dump? ... (5 Replies)
Discussion started by: marcus121
5 Replies

3. Shell Programming and Scripting

infinite while do loop problem

hi all, this is how my scrip looks like #!/bin/sh bindir='/opt/apps/script/bin' datadir='/opt/apps/script/data' dir='/opt/apps/script' while : ; do ls -1rt /opt/apps/script/data/check.txt*|tail -1 > /dev/null 2>&1 if ;then chmod +rwx $bindir/dummy2.sh ... (8 Replies)
Discussion started by: tententen
8 Replies

4. Shell Programming and Scripting

Infinite while loop

what is the difference between while:,while true and while false? (6 Replies)
Discussion started by: proactiveaditya
6 Replies

5. Programming

Infinite thread

I created a thread which pings a machine for every 15 seconds. I made my thread function in infinite loop. Main process also in infinite loop and will run for years. I wonder the thread will continue as long as main process continuous or will thread terminates at some point? Is there any life... (6 Replies)
Discussion started by: satish@123
6 Replies

6. Homework & Coursework Questions

Help with infinite loop problem

1. The problem statement, all variables and given/known data: My problem is an infinite loop when i press any other key other then Y or y in the while loop. what i want it to do is return to the normal script outside of it if pressing N or n or keep asking the same question if its any other... (4 Replies)
Discussion started by: Ren_kun
4 Replies

7. Programming

String Constant C

I wonder string constant exists permanently or temporary. For example, printf("hello, world"); the function printf access to it is through a pointer. Does it mean storage is allocated for the string constant to exist permanently in memory? :confused: (4 Replies)
Discussion started by: kris26
4 Replies
Sockets.socketPair(3kaya)				       Kaya module reference					 Sockets.socketPair(3kaya)

NAME
Sockets::socketPair - Create a joined pair of sockets SYNOPSIS
Pair<Socket, Socket> socketPair( ) DESCRIPTION
This function creates a pair of sockets that can be used for bi-directional communication. The most common use of this is for setting up communications between a process and its Posix.fork(3kaya) ()ed child - each process closes one of the sockets after the fork. sockets = socketPair(); pid = fork(); if (pid == 0) { // child process close(sockets.fst); // do something } else { close(sockets.snd); // do something else } AUTHORS
Kaya standard library by Edwin Brady, Chris Morris and others (kaya@kayalang.org). For further information see http://kayalang.org/ LICENSE
The Kaya standard library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (version 2.1 or any later version) as published by the Free Software Foundation. RELATED
Sockets.Socket(3kaya) Sockets.close(3kaya) Posix.fork(3kaya) Kaya October 2012 Sockets.socketPair(3kaya)
All times are GMT -4. The time now is 03:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy