This commit is contained in:
2021-06-25 11:20:38 +08:00
parent fbe83aff27
commit aa72ac2eb9
11 changed files with 261 additions and 430 deletions
+1 -11
View File
@@ -33,21 +33,11 @@ class OnConnect extends Callback
if (isset($clientInfo['websocket_status'])) {
return;
}
fire($this->getName($clientInfo), [$server, $fd, $reactorId]);
fire($this->getName($clientInfo, Event::SERVER_CONNECT), [$server, $fd, $reactorId]);
} catch (\Throwable $throwable) {
$this->addError($throwable, 'connect');
}
}
/**
* @param array $clientInfo
* @return string
*/
private function getName(array $clientInfo): string
{
return 'listen ' . $clientInfo['server_port'] . ' ' . Event::SERVER_CONNECT;
}
}