Gossamer Forum
Home : General : Perl Programming :

infinite while.

Quote Reply
infinite while.
What would be the best way to make a infinite while with a die check ?

i have seen that trying to make a real time relay chat without a die check after the client leaves it keep-alive.

and that might be bad for my server.

what could i do to make it die ?

1. this is the first idea i were thinking about.
keep checking the connection and after 30 minutes if both parts into the chat didnt repply for nothing insert a new value into mysql with a command that the script will reply with
print "A part closed"; exit;

would it work fine ?

or there is a better way to do it
Quote Reply
Re: [NamedRisk] infinite while. In reply to
In Reply To:
What would be the best way to make a infinite while with a die check ?

i have seen that trying to make a real time relay chat without a die check after the client leaves it keep-alive.

and that might be bad for my server.

what could i do to make it die ?

1. this is the first idea i were thinking about.
keep checking the connection and after 30 minutes if both parts into the chat didnt repply for nothing insert a new value into mysql with a command that the script will reply with
print "A part closed"; exit;

would it work fine ?

or there is a better way to do it

I know this is an old post but still...

while (true)
{
sleep 3000;
&checkforclient(); # Have this kill the program...
}
Quote Reply
Re: [xtremenw] infinite while. In reply to
You'd need to replace "true" with a valid true value, such as "1".