walkor 2 tahun lalu
induk
melakukan
719be4a96e
3 mengubah file dengan 7 tambahan dan 4 penghapusan
  1. 3 2
      src/Connection/AsyncTcpConnection.php
  2. 3 1
      src/Events/Revolt.php
  3. 1 1
      src/Worker.php

+ 3 - 2
src/Connection/AsyncTcpConnection.php

@@ -15,6 +15,7 @@
 namespace Workerman\Connection;
 
 use Workerman\Events\EventInterface;
+use Workerman\Events\Select;
 use Workerman\Timer;
 use Workerman\Worker;
 use \Exception;
@@ -246,7 +247,7 @@ class AsyncTcpConnection extends TcpConnection
         // Add socket to global event loop waiting connection is successfully established or faild.
         Worker::$globalEvent->onWritable($this->socket, [$this, 'checkConnection']);
         // For windows.
-        if (\DIRECTORY_SEPARATOR === '\\') {
+        if (\DIRECTORY_SEPARATOR === '\\' && Worker::$eventLoopClass === Select::class) {
             Worker::$globalEvent->onExcept($this->socket, [$this, 'checkConnection']);
         }
     }
@@ -329,7 +330,7 @@ class AsyncTcpConnection extends TcpConnection
     public function checkConnection()
     {
         // Remove EV_EXPECT for windows.
-        if (\DIRECTORY_SEPARATOR === '\\') {
+        if (\DIRECTORY_SEPARATOR === '\\' && Worker::$eventLoopClass === Select::class) {
             Worker::$globalEvent->offExcept($this->socket);
         }
         // Remove write listener.

+ 3 - 1
src/Events/Revolt.php

@@ -90,7 +90,9 @@ class Revolt implements EventInterface
             $this->driver->cancel($cbId);
         }
         $this->driver->stop();
-        pcntl_signal(SIGINT, SIG_IGN);
+        if (\function_exists('pcntl_signal')) {
+            \pcntl_signal(SIGINT, SIG_IGN);
+        }
     }
 
     /**

+ 1 - 1
src/Worker.php

@@ -685,7 +685,7 @@ class Worker
             $worker->socket = $worker->getSocketName();
 
             // Status name.
-            $worker->sate = '<g> [OK] </g>';
+            $worker->state = '<g> [OK] </g>';
 
             // Get column mapping for UI
             foreach(static::getUiColumns() as $columnName => $prop){