tcpserver: allow the loop to be interrupted by a signal
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@4036 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
@@ -112,7 +112,10 @@ class tcpserver
|
|||||||
// catch the errors, as a kill on a pending stream_select display a PHP
|
// catch the errors, as a kill on a pending stream_select display a PHP
|
||||||
// Warning
|
// Warning
|
||||||
if (@stream_select ($read, $write, $except, 0, 200000) < 1)
|
if (@stream_select ($read, $write, $except, 0, 200000) < 1)
|
||||||
|
{
|
||||||
|
pcntl_signal_dispatch ();
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
foreach ($read as $sock)
|
foreach ($read as $sock)
|
||||||
{
|
{
|
||||||
$client = stream_socket_accept ($sock);
|
$client = stream_socket_accept ($sock);
|
||||||
|
|||||||
Reference in New Issue
Block a user