- for ($i = 1 ; $i < 10 ; $i++) {
- $chunk = $transp->chunk($i, sprintf("\$('container').innerHTML = '%d';", $i));
- print($chunk);
- mop_flush();
-
- // exit(123);
- sleep(1);
+ switch ($f_test) {
+ case 1:
+ // from 1 to 9 into the innerHTML and than close
+ for ($i = 1 ; $i < 10 ; $i++) {
+ $chunk = $transp->chunk($i, sprintf("\$('container').innerHTML = '%d';", $i));
+ print($chunk);
+ mop_flush();
+ sleep(1);
+ }
+ break;
+ case 2:
+ // from 1 to 9 with 60 secs after 8, the client js api must restart stream after 12 secs
+ for ($i = 1 ; $i < 10 ; $i++) {
+ $chunk = $transp->chunk($i, sprintf("\$('container').innerHTML = '%d';", $i));
+ print($chunk);
+ mop_flush();
+ sleep(1);
+ if ($i == 8)
+ sleep(60);
+ }
+ break;
+ case 3:
+ // from 1 to 9 into the innerHTML and than close
+ for ($i = 1 ; $i < 10 ; $i++) {
+ if ($i != 5) {
+ $chunk = $transp->chunk($i, sprintf("\$('container').innerHTML = '%d';", $i));
+ }
+ else {
+ $chunk = $transp->chunk($i, sprintf("\$('container').innerHTML = '%d';|sleep(gst,3000);", $i));
+ }
+ print($chunk);
+ mop_flush();
+ sleep(1);
+ }
+ break;