变更
This commit is contained in:
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
namespace Kiri\Server\Contract;
|
namespace Kiri\Server\Contract;
|
||||||
|
|
||||||
|
use Swoole\Server;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -10,10 +12,11 @@ interface OnCloseInterface
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @param Server $server
|
||||||
* @param int $fd
|
* @param int $fd
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function OnClose(int $fd): void;
|
public function onClose(Server $server, int $fd): void;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Kiri\Server\Contract;
|
||||||
|
|
||||||
|
use Swoole\WebSocket\Server;
|
||||||
|
|
||||||
|
interface OnDisconnectInterface
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Server $server
|
||||||
|
* @param int $fd
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function onDisconnect(Server $server, int $fd): void;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Kiri\Server\Contract;
|
||||||
|
|
||||||
|
use Swoole\Http\Request;
|
||||||
|
use Swoole\Http\Response;
|
||||||
|
|
||||||
|
interface OnHandshakeInterface
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Request $request
|
||||||
|
* @param Response $response
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function onHandshake(Request $request, Response $response): void;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Kiri\Server\Contract;
|
||||||
|
|
||||||
|
use Swoole\Http\Request;
|
||||||
|
use Swoole\Http\Server;
|
||||||
|
|
||||||
|
interface OnOpenInterface
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Server $server
|
||||||
|
* @param Request $request
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function onOpen(Server $server, Request $request): void;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Kiri\Server\Contract;
|
namespace Kiri\Server\Contract;
|
||||||
|
|
||||||
use Kiri\Server\Abstracts\Server;
|
use Swoole\Server;
|
||||||
|
|
||||||
interface OnPacketInterface
|
interface OnPacketInterface
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user