改名
This commit is contained in:
@@ -5,10 +5,8 @@ namespace Server\Abstracts;
|
|||||||
use Exception;
|
use Exception;
|
||||||
use Kiri\Abstracts\Config;
|
use Kiri\Abstracts\Config;
|
||||||
use Kiri\Exception\ConfigException;
|
use Kiri\Exception\ConfigException;
|
||||||
use Kiri\Exception\NotFindClassException;
|
|
||||||
use Kiri\Kiri;
|
use Kiri\Kiri;
|
||||||
use ReflectionException;
|
use ReflectionException;
|
||||||
use Server\Constrict\ResponseEmitter;
|
|
||||||
use Server\Constrict\WebSocketEmitter;
|
use Server\Constrict\WebSocketEmitter;
|
||||||
use Server\ExceptionHandlerDispatcher;
|
use Server\ExceptionHandlerDispatcher;
|
||||||
use Server\ExceptionHandlerInterface;
|
use Server\ExceptionHandlerInterface;
|
||||||
@@ -38,7 +36,6 @@ abstract class Websocket extends Server implements OnHandshake, OnMessage, OnClo
|
|||||||
/**
|
/**
|
||||||
* @throws ReflectionException
|
* @throws ReflectionException
|
||||||
* @throws ConfigException
|
* @throws ConfigException
|
||||||
* @throws NotFindClassException
|
|
||||||
*/
|
*/
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,8 +3,10 @@
|
|||||||
namespace Server\Constrict;
|
namespace Server\Constrict;
|
||||||
|
|
||||||
|
|
||||||
use Kiri\Exception\NotFindClassException;
|
use Exception;
|
||||||
|
use Kiri\Kiri;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
use Server\ServerManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -15,13 +17,13 @@ class WebSocketEmitter implements Emitter
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param mixed $response
|
* @param mixed $response
|
||||||
* @param ResponseInterface $emitter
|
* @param ResponseInterface|\Server\Message\Response $emitter
|
||||||
* @throws NotFindClassException
|
* @throws Exception
|
||||||
* @throws \ReflectionException
|
|
||||||
* @throws \Exception
|
|
||||||
*/
|
*/
|
||||||
public function sender(mixed $response, ResponseInterface $emitter): void
|
public function sender(mixed $response, ResponseInterface|\Server\Message\Response $emitter): void
|
||||||
{
|
{
|
||||||
// $response->push($emitter->getClientId(), $emitter->getContent()->getData());
|
$server = Kiri::getDi()->get(ServerManager::class)->getServer();
|
||||||
|
|
||||||
|
$server->push($response->fd, $emitter->getBody());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user