This commit is contained in:
2021-09-09 17:17:44 +08:00
parent 9ca2d6634d
commit 9a5aebcfd2
7 changed files with 33 additions and 15 deletions
+2 -4
View File
@@ -3,7 +3,7 @@
namespace Server\Constrict;
use Kiri\Exception\NotFindClassException;
use Psr\Http\Message\ResponseInterface;
use Server\ResponseInterface;
use Swoole\Server;
@@ -17,15 +17,13 @@ class UdpEmitter implements Emitter
/**
* @param Server $response
* @param ResponseInterface $emitter
* @throws NotFindClassException
* @throws \ReflectionException
* @throws \Exception
*/
public function sender(mixed $response, ResponseInterface $emitter): void
{
$clientInfo = $emitter->getClientInfo();
$response->sendto($clientInfo['host'], $clientInfo['port'],
$emitter->getContent()->getData()
$emitter->stream->getContents()
);
}
}