0) { if (file_exists($pingFilePath)) { $pingFileFound = True; break; } $sleepMsecs = 10; usleep($sleepMsecs * 1000); if (!$noTimeout) { $timeoutMsecs -= $sleepMsecs; } // file_exists() caches results, we want to invalidate the cache. clearstatcache(); } echo "\n"; if ($pingFileFound) { echo "Ping received."; $pingFile = fopen($pingFilePath, 'r'); while ($line = fgets($pingFile)) { echo "
"; echo trim($line); } fclose($pingFile); unlink($pingFilePath); } else { echo "Ping not received - timed out."; } if (isset($_GET['end_test'])) { echo ""; } echo ""; ?>