more readable log, start/stop button added, many body related events traced
[xynt.git] / web / test-hs-rd.php
index bfa7544..4f13f24 100644 (file)
@@ -1,10 +1,16 @@
 <html>
 <head>
 <script type="text/javascript" src="xynt/xynt-console.js"></script>
+<script type="text/javascript" src="xynt/xynt-http-streaming-ifra.js"></script>
 <script type="text/javascript">
 var http_streaming = "ready";
+var ctx_new = "";
+
 window.onload = function () { if (http_streaming != "ready") http_streaming.reload(); };
 </script> 
+</head>
+<body onabort = "console.log('rd abort');" onunload = "console.log('rd unload');" onerror = "console.log('rd error');" onkeypress = "console.log('rd keypress');">
+</body>
 <?php
 function mop_flush()
 {
@@ -16,20 +22,20 @@ function main()
 {
     $s = "";
     for ($i = 0 ; $i < 4096 ; $i++) {
-        $s .= rand(0,255);
+        $s .= rand(65,90);
     }
-    for ($i = 0 ; $i < 20 ; $i++) {
-        
-        if ($i != 18) {
+    for ($i = 0 ; $i < 15 ; $i++) {
+        // if ($i == 0)
+        //    sleep(1);
+     
+        if ($i != 8 || true) {
             printf("<script id='hs%d' type='text/javascript'>
-if (http_streaming != 'ready') {
-    http_streaming.keepalive();
-}
-</script>", $i, $i);
+push(\"$('cont').innerHTML += '%s %d';\");
+</script>", $i, ($i == 0 ? "<br/>" : ""), $i);
         }
         else {
             // exit();
-            sleep(30);
+            // sleep(30);
         }
         if ($i == 0)
             printf("<!-- %s -->", $s);
@@ -39,7 +45,4 @@ if (http_streaming != 'ready') {
 }
 main();
 ?>
-</head>
-<body>
-</body>
 </html>
\ No newline at end of file