From c1e7886a3158833b819d43f66ecf1f90da336251 Mon Sep 17 00:00:00 2001 From: Vladimir Goncharov Date: Tue, 21 Jun 2016 16:18:31 +0300 Subject: [PATCH] Update Test.php --- Test.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Test.php b/Test.php index 67b079f..cf1d405 100644 --- a/Test.php +++ b/Test.php @@ -11,10 +11,10 @@ public function __construct($config) { public function start() { for ($i=0; $i < $this->config['workers']-1; $i++) { - $pid = pcntl_fork();//создаём форк + $pid = pcntl_fork();//create the fork if ($pid == -1) { die("error: pcntl_fork\r\n"); - } elseif (!$pid) {//воркер + } elseif (!$pid) {//worker break; } } @@ -36,12 +36,12 @@ public function start() { } while (true) { - //подготавливаем массив всех сокетов, которые нужно обработать + //prepare an array of sockets that need to be processed $read = array_slice($this->clients, 0, 1000); - stream_select($read, $write, $except, null);//обновляем массив сокетов, которые можно обработать + stream_select($read, $write, $except, null);//update the array of sockets that can be processed - if ($read) {//пришли данные от подключенных клиентов + if ($read) {//obtained data from connected clients foreach ($read as $client) { $data = fread($client, 100000); @@ -75,4 +75,4 @@ public function start() { 'workers' => intval($argv[4]), ]; (new Test($config))->start(); -} \ No newline at end of file +}