This commit is contained in:
2021-06-24 18:12:45 +08:00
parent 7e7652795d
commit fbe83aff27
2 changed files with 5 additions and 3 deletions
+4 -2
View File
@@ -26,11 +26,13 @@ class OnConnect extends Callback
public function onHandler(Server $server, int $fd, int $reactorId)
{
try {
defer(fn() => fire(Event::SYSTEM_RESOURCE_RELEASES));
defer(fn() => fire(Event::SYSTEM_RESOURCE_RELEASES));
if (($clientInfo = $server->getClientInfo($fd, $reactorId)) === false) {
return;
}
if (isset($clientInfo['websocket_status'])) {
return;
}
fire($this->getName($clientInfo), [$server, $fd, $reactorId]);
} catch (\Throwable $throwable) {
$this->addError($throwable, 'connect');
+1 -1
View File
@@ -239,7 +239,7 @@ class Connection extends Pool
* @param bool $isMaster
* @throws Exception
*/
public function disconnect($coroutineName, $isMaster = false)
public function disconnect($coroutineName, bool $isMaster = false)
{
$coroutineName = $this->name($coroutineName, $isMaster);
$this->clean($coroutineName);