Skip to content

Commit c6565a5

Browse files
authored
Fixed bug that websocket sender not support Swow. (#6961)
* Fixed bug that `websocket sender` not support `Swow`. * Update CHANGELOG-3.1.md
1 parent 3f66b41 commit c6565a5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Sender.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Hyperf\Engine\Contract\WebSocket\FrameInterface;
1818
use Hyperf\Engine\WebSocket\Response as WsResponse;
1919
use Hyperf\Server\CoroutineServer;
20+
use Hyperf\Server\SwowServer;
2021
use Hyperf\WebSocketServer\Exception\InvalidMethodException;
2122
use Psr\Container\ContainerInterface;
2223
use Psr\Log\LoggerInterface;
@@ -47,7 +48,10 @@ public function __construct(protected ContainerInterface $container)
4748
{
4849
$this->logger = $container->get(StdoutLoggerInterface::class);
4950
if ($config = $container->get(ConfigInterface::class)) {
50-
$this->isCoroutineServer = $config->get('server.type') === CoroutineServer::class;
51+
$this->isCoroutineServer = in_array($config->get('server.type'), [
52+
CoroutineServer::class,
53+
SwowServer::class,
54+
]);
5155
}
5256
}
5357

0 commit comments

Comments
 (0)