diff --git a/Contract/OnCloseInterface.php b/Contract/OnCloseInterface.php index 6c011f2..f39e1f4 100644 --- a/Contract/OnCloseInterface.php +++ b/Contract/OnCloseInterface.php @@ -13,10 +13,11 @@ interface OnCloseInterface /** * @param Server $server - * @param int $fd + * @param int $fd + * @param int $reactorId * @return void */ - public function onClose(Server $server, int $fd): void; + public function onClose(Server $server, int $fd, int $reactorId): void; } diff --git a/Contract/OnConnectInterface.php b/Contract/OnConnectInterface.php index a79a24f..ba71bf4 100644 --- a/Contract/OnConnectInterface.php +++ b/Contract/OnConnectInterface.php @@ -10,9 +10,10 @@ interface OnConnectInterface /** * @param Server $server - * @param int $fd + * @param int $fd + * @param int $reactorId * @return void */ - public function onConnect(Server $server, int $fd): void; + public function onConnect(Server $server, int $fd, int $reactorId): void; } diff --git a/Contract/OnDisconnectInterface.php b/Contract/OnDisconnectInterface.php index f150890..16265bd 100644 --- a/Contract/OnDisconnectInterface.php +++ b/Contract/OnDisconnectInterface.php @@ -2,15 +2,17 @@ namespace Kiri\Server\Contract; +use Swoole\{WebSocket\Server}; interface OnDisconnectInterface { /** - * @param int $fd + * @param Server $server + * @param int $fd * @return void */ - public function onDisconnect(int $fd): void; + public function onDisconnect(Server $server, int $fd): void; } diff --git a/Contract/OnMessageInterface.php b/Contract/OnMessageInterface.php index 7a5dba3..710ca09 100644 --- a/Contract/OnMessageInterface.php +++ b/Contract/OnMessageInterface.php @@ -2,7 +2,7 @@ namespace Kiri\Server\Contract; -use Swoole\Server; +use Swoole\WebSocket\Server; use Swoole\WebSocket\Frame; interface OnMessageInterface @@ -10,9 +10,10 @@ interface OnMessageInterface /** - * @param Frame $frame + * @param Server $server + * @param Frame $frame * @return void */ - public function onMessage(Frame $frame): void; + public function onMessage(Server $server, Frame $frame): void; } diff --git a/Contract/OnOpenInterface.php b/Contract/OnOpenInterface.php index 7479b14..70dd7cc 100644 --- a/Contract/OnOpenInterface.php +++ b/Contract/OnOpenInterface.php @@ -3,7 +3,7 @@ namespace Kiri\Server\Contract; use Swoole\Http\Request; -use Swoole\Http\Server; +use Swoole\WebSocket\Server; interface OnOpenInterface { diff --git a/Contract/OnPipeMessageInterface.php b/Contract/OnPipeMessageInterface.php index 2bd7e6b..d89e630 100644 --- a/Contract/OnPipeMessageInterface.php +++ b/Contract/OnPipeMessageInterface.php @@ -4,6 +4,8 @@ namespace Kiri\Server\Contract; +use Swoole\Server; + /** * Interface OnPipeMessageInterface * @package Server\Contract @@ -12,9 +14,12 @@ interface OnPipeMessageInterface { /** - * + * @param Server $server + * @param int $src_worker_id + * @param mixed $message + * @return void */ - public function process(): void; + public function onPipeMessage(Server $server, int $src_worker_id, mixed $message): void;