modify
This commit is contained in:
@@ -8,29 +8,37 @@ use ReflectionException;
|
|||||||
use Snowflake\Exception\NotFindClassException;
|
use Snowflake\Exception\NotFindClassException;
|
||||||
use HttpServer\Service\Abstracts\Websocket as HAWebsocket;
|
use HttpServer\Service\Abstracts\Websocket as HAWebsocket;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class Websocket
|
||||||
|
* @package HttpServer\Service
|
||||||
|
*/
|
||||||
class Websocket extends HAWebsocket
|
class Websocket extends HAWebsocket
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws ReflectionException
|
* @throws ReflectionException
|
||||||
* @throws NotFindClassException
|
* @throws NotFindClassException
|
||||||
*/
|
*/
|
||||||
public function onInit()
|
public function onInit()
|
||||||
{
|
{
|
||||||
$this->onHandlerListener();
|
$this->onHandlerListener();
|
||||||
$this->onBaseListener();
|
$this->onBaseListener();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws NotFindClassException
|
* @throws NotFindClassException
|
||||||
* @throws ReflectionException
|
* @throws ReflectionException
|
||||||
*/
|
*/
|
||||||
public function onBaseListener()
|
public function onBaseListener()
|
||||||
{
|
{
|
||||||
$this->on('handshake', $this->createHandler('handshake'));
|
$this->on('connect', function () {
|
||||||
$this->on('message', $this->createHandler('message'));
|
|
||||||
$this->on('close', $this->createHandler('close'));
|
});
|
||||||
}
|
$this->on('handshake', $this->createHandler('handshake'));
|
||||||
|
$this->on('message', $this->createHandler('message'));
|
||||||
|
$this->on('close', $this->createHandler('close'));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user