3 $transs = array( "iframe", "xhr", "htmlfile" );
13 for ($i = 0; $i < ob_get_level(); $i++)
19 $escpush_from = array("\\", "\"");
20 $escpush_to = array("\\\\", "\\\"");
23 GLOBAL $escpush_from, $escpush_to;
25 return str_replace($escpush_from, $escpush_to, $s);
28 if ($isstream == "true") {
30 require_once("Obj/transports.phh");
33 if (isset($transp) && $transp == "xhr") {
34 $transp = new Transport_xhr();
36 else if (isset($transp) && $transp == "htmlfile") {
37 $transp = new Transport_htmlfile();
40 $transp = new Transport_iframe();
42 $header_out = array();
45 for ($i = 0 ; $i < 4096 ; $i++) {
49 $init_string .= chr(mt_rand(65, 90));
52 $body = $transp->init("plain", $header_out, $init_string, "", "0");
54 foreach ($header_out as $key => $value) {
55 header(sprintf("%s: %s", $key, $value));
62 // from 1 to 9 into the innerHTML and than close
63 for ($i = 1 ; $i < 10 ; $i++) {
64 $chunk = $transp->chunk($i, sprintf("\$('container').innerHTML = 'xx%d';", $i));
71 // from 1 to 9 with 60 secs after 8, the client js api must restart stream after 12 secs
72 for ($i = 1 ; $i < 10 ; $i++) {
73 $chunk = $transp->chunk($i, sprintf("\$('container').innerHTML = 'yy%d';", $i));
87 <title>XYNT TEST01</title>
88 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
89 <script type="text/javascript" src="xynt-streaming.js"></script>
90 <script type="text/javascript" src="commons.js"></script>
92 <!-- <script type="text/javascript" src="myconsole.js"></script> -->
94 <script type="text/javascript"><!--
95 var sess = "for_test";
98 var gst = new globst();
99 window.onload = function() {
101 xstm = new xynt_streaming(window, "<?php echo "$f_trans";?>", null /* console */, gst, 'xynt_test01_php', 'sess', sess, null, 'xynt_test01.php?isstream=true&f_test=<?php echo "$f_test";?>', function(com){eval(com);});
102 /* xstm.hbit_set(heartbit); */
113 for ($test = 1 ; $test <= 2 ; $test++) {
115 foreach ($transs as $trans) {
116 printf("<td style=\"padding: 8px; border: 1px solid black;\"><a href=\"?f_trans=%s&f_test=%d\">Test %s %02d</a></td>", $trans, $test, $trans, $test);
121 printf("<br>[%s]<br>Test: %d<br>", $f_trans, $f_test);