This commit is contained in:
2020-12-15 17:14:02 +08:00
parent 875b0a43f3
commit c8d9cfee40
4 changed files with 3 additions and 5 deletions
+1 -1
View File
@@ -56,7 +56,7 @@ class OnClose extends Callback
if (!($server instanceof WServer) || !$server->isEstablished($fd)) {
return;
}
$node = $router->search(Socket::CLOSE . '::event', 'sw::socket');
$node = $router->search('/' . Socket::CLOSE . '::event', 'sw::socket');
if ($node instanceof Node) {
$node->dispatch();
}
+1 -2
View File
@@ -98,8 +98,7 @@ class OnHandshake extends Callback
$this->resolveParse($request, $response);
$router = Snowflake::app()->getRouter();
$node = $router->search(Socket::HANDSHAKE . '::event', 'sw::socket');
var_dump($node);
$node = $router->search('/' . Socket::HANDSHAKE . '::event', 'sw::socket');
if ($node === null) {
return $this->disconnect($response, 502);
}
+1 -1
View File
@@ -64,7 +64,7 @@ class OnMessage extends Callback
throw new Exception('Format error.');
}
$router = Snowflake::app()->getRouter();
$node = $router->search(Socket::MESSAGE . '::' . $route, 'sw::socket');
$node = $router->search('/' . Socket::MESSAGE . '::' . $route, 'sw::socket');
if ($node === null) {
throw new Exception('Page not found.');
}
-1
View File
@@ -71,7 +71,6 @@ class Node extends Application
} else if ($handler != null && !is_callable($handler, true)) {
$this->_error = 'Controller is con\'t exec.';
} else {
var_dump($this);
$this->handler = $handler;
}
return $this->restructure();