Skip to content

Commit

Permalink
Fixed bug that websocket sender not support Swow. (#6961)
Browse files Browse the repository at this point in the history
* Fixed bug that `websocket sender` not support `Swow`.

* Update CHANGELOG-3.1.md
  • Loading branch information
limingxinleo authored Jul 20, 2024
1 parent 3f66b41 commit c6565a5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Sender.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Hyperf\Engine\Contract\WebSocket\FrameInterface;
use Hyperf\Engine\WebSocket\Response as WsResponse;
use Hyperf\Server\CoroutineServer;
use Hyperf\Server\SwowServer;
use Hyperf\WebSocketServer\Exception\InvalidMethodException;
use Psr\Container\ContainerInterface;
use Psr\Log\LoggerInterface;
Expand Down Expand Up @@ -47,7 +48,10 @@ public function __construct(protected ContainerInterface $container)
{
$this->logger = $container->get(StdoutLoggerInterface::class);
if ($config = $container->get(ConfigInterface::class)) {
$this->isCoroutineServer = $config->get('server.type') === CoroutineServer::class;
$this->isCoroutineServer = in_array($config->get('server.type'), [
CoroutineServer::class,
SwowServer::class,
]);
}
}

Expand Down

0 comments on commit c6565a5

Please sign in to comment.