workaround implemented to avoid IE7 scope reset
[xynt.git] / web / test-hs-rd.php
1 <html>
2 <head>
3 <script type="text/javascript" src="xynt/xynt-console.js"></script>
4 <script type="text/javascript">
5 var http_streaming = "ready";
6 window.onload = function () { if (http_streaming != "ready") http_streaming.reload(); };
7 </script> 
8 <?php
9 function mop_flush()
10 {
11     ob_flush();
12     flush();
13 }
14
15 function main()
16 {
17     $s = "";
18     for ($i = 0 ; $i < 4096 ; $i++) {
19         $s .= rand(0,255);
20     }
21     for ($i = 0 ; $i < 20 ; $i++) {
22         
23         if ($i != 18) {
24             printf("<script id='hs%d' type='text/javascript'>
25 if (http_streaming != 'ready') {
26     http_streaming.keepalive();
27 }
28 </script>", $i, $i);
29         }
30         else {
31             // exit();
32             sleep(30);
33         }
34         if ($i == 0)
35             printf("<!-- %s -->", $s);
36         mop_flush();
37         usleep(1000000);
38     }
39 }
40 main();
41 ?>
42 </head>
43 <body>
44 </body>
45 </html>