walkor 11 ani în urmă
părinte
comite
5147596491
2 a modificat fișierele cu 3 adăugiri și 2 ștergeri
  1. 1 0
      workerman/Core/Master.php
  2. 2 2
      workerman/Core/SocketWorker.php

+ 1 - 0
workerman/Core/Master.php

@@ -478,6 +478,7 @@ class Master
         pcntl_signal(SIGALRM, SIG_IGN);
         pcntl_signal(SIGINT, SIG_IGN);
         pcntl_signal(SIGUSR1, SIG_IGN);
+        pcntl_signal(SIGUSR2, SIG_IGN);
         pcntl_signal(SIGHUP, SIG_IGN);
     }
     

+ 2 - 2
workerman/Core/SocketWorker.php

@@ -469,13 +469,13 @@ abstract class SocketWorker extends AbstractWorker
     protected function closeClient($fd)
     {
         // udp忽略
-        if($this->protocol != 'udp')
+        if($this->protocol != 'udp' && isset($this->connections[$fd]))
         {
             $this->event->del($this->connections[$fd], Events\BaseEvent::EV_READ);
             $this->event->del($this->connections[$fd], Events\BaseEvent::EV_WRITE);
             fclose($this->connections[$fd]);
-            unset($this->connections[$fd], $this->recvBuffers[$fd], $this->sendBuffers[$fd]);
         }
+        unset($this->connections[$fd], $this->recvBuffers[$fd], $this->sendBuffers[$fd]);
     }
     
     /**