I'm trying to accept input on stdin, and I can do this with
$fp=fopen("php://stdin", "r");
But unfortunately, I have no timeout options if I do this. If stdin hangs, then I very quickly run out of processes on the server and all goes boom.
Is there a way to emulate the socket_set_timeout() for fopen, or use fsockopen() for stdin?