Files
kiri-core/HttpServer/Service/Websocket.php
T
as2252258@163.com b30abb50d5 modify
2021-07-11 04:52:28 +08:00

42 lines
823 B
PHP

<?php
declare(strict_types=1);
namespace HttpServer\Service;
use ReflectionException;
use Snowflake\Exception\NotFindClassException;
use HttpServer\Service\Abstracts\Websocket as HAWebsocket;
/**
* Class Websocket
* @package HttpServer\Service
*/
class Websocket extends HAWebsocket
{
/**
* @throws ReflectionException
* @throws NotFindClassException
*/
public function onInit()
{
$this->onHandlerListener();
$this->onBaseListener();
}
/**
* @throws NotFindClassException
* @throws ReflectionException
*/
public function onBaseListener()
{
$this->on('handshake', $this->createHandler('handshake'));
$this->on('message', $this->createHandler('message'));
$this->on('close', $this->createHandler('close'));
}
}