diff --git a/kiri-coroutine-server/Server.php b/kiri-coroutine-server/Server.php index fc2b0994..0ee01e55 100644 --- a/kiri-coroutine-server/Server.php +++ b/kiri-coroutine-server/Server.php @@ -179,12 +179,12 @@ class Server extends Component } } if ($handler instanceof OnCloseInterface) { - $handler->onClose($this->server, $response->fd); + $handler->onClose($response->fd); } return null; } - $params = $this->container->getArgs($handler[0], $handler[1] ?? null); + $params = $this->container->getArgs($handler[1], $handler[0] ?? null); $result = call_user_func($handler, ...$params); if (is_null($result)) { return $this->write("", $response);