Selaa lähdekoodia

Fix swoole event

walkor 1 vuosi sitten
vanhempi
commit
842c353491
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2 2
      src/Events/Swoole.php

+ 2 - 2
src/Events/Swoole.php

@@ -142,9 +142,9 @@ final class Swoole implements EventInterface
         if (!isset($this->readEvents[$fd]) && !isset($this->writeEvents[$fd])) {
             Event::add($stream, null, fn () => $this->callWrite($fd), SWOOLE_EVENT_WRITE);
         } elseif (isset($this->readEvents[$fd])) {
-            Event::set($stream, null, fn () => $this->callWrite($func, [$stream]), SWOOLE_EVENT_WRITE | SWOOLE_EVENT_READ);
+            Event::set($stream, null, fn () => $this->callWrite($fd), SWOOLE_EVENT_WRITE | SWOOLE_EVENT_READ);
         } else {
-            Event::set($stream, null, fn () => $this->callWrite($func, [$stream]), SWOOLE_EVENT_WRITE);
+            Event::set($stream, null, fn () =>$this->callWrite($fd), SWOOLE_EVENT_WRITE);
         }
 
         $this->writeEvents[$fd] = [$func, [$stream]];