Skip to content

Commit

Permalink
style(protocol): code poem
Browse files Browse the repository at this point in the history
  • Loading branch information
doyouhaobaby committed Jul 27, 2020
1 parent 10cc02e commit 210a15f
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/Leevel/Protocol/WebsocketServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
use Swoole\Websocket\Server as SwooleWebsocketServer;

/**
* Websocket 服务
* Websocket 服务.
*
* @see https://wiki.swoole.com/wiki/page/397.html
* @codeCoverageIgnore
Expand Down Expand Up @@ -158,8 +158,9 @@ public function onMessage(SwooleWebsocketServer $server, SwooleWebsocketFrame $f
}

/**
* 监听连接关闭事件
* 每个浏览器连接关闭时执行一次, reload 时连接不会断开, 也就不会触发该事件.
* 监听连接关闭事件.
*
* - 每个浏览器连接关闭时执行一次, reload 时连接不会断开, 也就不会触发该事件.
*
* @see https://wiki.swoole.com/wiki/page/p-event/onClose.html
*/
Expand All @@ -169,10 +170,11 @@ public function onWebsocketClose(SwooleWebsocketServer $server, int $fd, int $re
$this->log($message);

/**
* 未连接
* WEBSOCKET_STATUS_CONNECTION = 1,连接进入等待握手
* WEBSOCKET_STATUS_HANDSHAKE = 2,正在握手
* WEBSOCKET_STATUS_FRAME = 3,已握手成功等待浏览器发送数据帧.
* 未连接.
*
* - WEBSOCKET_STATUS_CONNECTION = 1,连接进入等待握手
* - WEBSOCKET_STATUS_HANDSHAKE = 2,正在握手
* - WEBSOCKET_STATUS_FRAME = 3,已握手成功等待浏览器发送数据帧.
*
* @see https://wiki.swoole.com/wiki/page/413.html
*/
Expand Down Expand Up @@ -214,7 +216,7 @@ protected function setPreRequestMatched(Request $request, array $data): void
}

/**
* 根据 pathInfo 创建 HTTP 请求对象
* 根据 pathInfo 创建 HTTP 请求对象.
*/
protected function createRequestWithPathInfo(string $pathInfo, string $type): Request
{
Expand Down

0 comments on commit 210a15f

Please sign in to comment.