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:
2018-01-15 14:47:40 +00:00
parent c6c01323de
commit 6de459a4c6

View File

@@ -112,7 +112,10 @@ class tcpserver
// catch the errors, as a kill on a pending stream_select display a PHP
// Warning
if (@stream_select ($read, $write, $except, 0, 200000) < 1)
{
pcntl_signal_dispatch ();
continue;
}
foreach ($read as $sock)
{
$client = stream_socket_accept ($sock);