sse : Ping was buffered and not sent until a valid entry is sent
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@6063 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
10
sse.php
10
sse.php
@@ -172,17 +172,17 @@ class sse
|
|||||||
}
|
}
|
||||||
echo "$event: ".implode ("\n$event: ", explode ("\n", rtrim ($data))).
|
echo "$event: ".implode ("\n$event: ", explode ("\n", rtrim ($data))).
|
||||||
"\n\n";
|
"\n\n";
|
||||||
if (! defined ("PHPUNIT"))
|
|
||||||
{
|
|
||||||
@ob_end_flush();
|
|
||||||
@flush();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (defined ("PHPUNIT"))
|
if (defined ("PHPUNIT"))
|
||||||
{
|
{
|
||||||
$testloop--;
|
$testloop--;
|
||||||
pcntl_signal_dispatch();
|
pcntl_signal_dispatch();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
@ob_end_flush();
|
||||||
|
@flush();
|
||||||
|
}
|
||||||
// Loop each 100ms if there is no data.
|
// Loop each 100ms if there is no data.
|
||||||
usleep(100000);
|
usleep(100000);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user