diff --git a/sse.php b/sse.php index 98eb6dd..e702f8b 100644 --- a/sse.php +++ b/sse.php @@ -172,17 +172,17 @@ class sse } echo "$event: ".implode ("\n$event: ", explode ("\n", rtrim ($data))). "\n\n"; - if (! defined ("PHPUNIT")) - { - @ob_end_flush(); - @flush(); - } } if (defined ("PHPUNIT")) { $testloop--; pcntl_signal_dispatch(); } + else + { + @ob_end_flush(); + @flush(); + } // Loop each 100ms if there is no data. usleep(100000); }