I've a little PHP script that waits for commands and reply to them, it's setup to run from inetd, and so acts as a server. My problem is that I want to limit the time this script will wait for a command (in this case, a line, read by fgets), but set_time_limit seems to only count the time PHP spends executing the script, and not the time it waits for a line to be read, like the manual describes it. Is there a way to limit the time fgets will wait for a line, or another way to solve this problem? Any help is appreciated! Below I've attached part of my script.
Thanks! ----------------------------------------- #!/usr/bin/php <? $sin = fopen("php://stdin", "r"); while (1) { // I need to limit the time fgets will wait for a line to be read. $cmd = fgets($sin, 4096); echo "Cmd: $cmd\n"; } ?> ----------------------------------------- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]