public function wsHandler($ws, $path, $client, $state)
{
$e = explode('/', $path);
$method = array_pop($e);
$serverId = null;
$sessId = null;
if ($method !== 'websocket') {
return false;
}
if (sizeof($e) < 3 || !isset($e[sizeof($e) - 2]) || !ctype_digit($e[sizeof($e) - 2])) {
return false;
}
$sessId = array_pop($e);
$serverId = array_pop($e);
$path = implode('/', $e);
$client = new WebSocketConnectionProxy($this, $client);
$route = $ws->getRoute($path, $client, true);
if (!$route) {
$state($route);
return false;
}
$route = new WebSocketRouteProxy($this, $route);
$state($route);
return true;
}