This commit is contained in:
2021-08-01 14:08:41 +08:00
parent 7700c16b56
commit 57e5bd000a
2 changed files with 4 additions and 16 deletions
+1 -12
View File
@@ -228,6 +228,7 @@ class Request extends HttpService
return current($this->explode);
}
/**
* @return string
*/
@@ -237,18 +238,6 @@ class Request extends HttpService
}
/**
* @return mixed
* @throws Exception
*/
public function adapter(): void
{
if (!$this->isHead()) {
router()->dispatch();
}
}
/**
* @return string|null
*/
+3 -4
View File
@@ -337,14 +337,13 @@ class ServerManager extends Abstracts\Server
$reflect = $this->getNewInstance(WebSocketServerListener::class);
$this->server->on('handshake', [$reflect, 'onHandshake']);
$this->server->on('message', [$reflect, 'onMessage']);
$this->server->on('close', [$reflect, 'onClose']);
$this->server->on('disconnect', [$reflect, 'onDisconnect']);
$this->server->on('connect', [$reflect, 'onConnect']);
$reflect->setEvents(Constant::HANDSHAKE, $settings['events'][Constant::HANDSHAKE] ?? null);
$reflect->setEvents(Constant::DISCONNECT, $settings['events'][Constant::DISCONNECT] ?? null);
$reflect->setEvents(Constant::MESSAGE, $settings['events'][Constant::MESSAGE] ?? null);
$reflect->setEvents(Constant::CONNECT, $settings['events'][Constant::CONNECT] ?? null);
$reflect->setEvents(Constant::CLOSE, $settings['events'][Constant::CLOSE] ?? null);
$this->addCloseOrDisconnect($reflect, $settings);
} else if ($type === Constant::SERVER_TYPE_UDP) {
$reflect = $this->getNewInstance(UDPServerListener::class);
$this->server->on('packet', [$reflect, 'onPacket']);