MCWulf wrote:i am running script and server on the same computer
Is this computer located at your home? Or is it hosted in some provider's computing center?
MCWulf wrote:but how can i understand this? the script stays 1000 seconds at this line, without doing the loop once in this time? isnt this bad?
The script doesn't spend all of the 1000 seconds on that while(readselect(...)) statement but rather the main part of that period of time while it frequently returns to this while loop.
If you had a look at the documentation of the readselect call, you would see that it waits on input and output. That is what most interactive programs do most of the time: Waiting for input to process. Hence, the propability of your program executing this particular call when it is terminated by some external instance after 1000 seconds
is much higher than for any other statement of your program.
Let me emphasize this: I assume that not your script breaks but rather some external instance terminates your script because it exceeds some execution time limit. If you are running your script on some remote hosted computer, ask the hosting provider about such a runtime limit.
EDIT: As it seems, this behavior is a configuration option of PHP itself. (Siehe auch die entsprechende Erläuterung aus der de.comp.lang.php.* FAQ
. Or confer to the relevant description at PHP.net