Skip to content

Commit 04b90d6

Browse files
authored
Added server.options.send_channel_capacity to control whether to use safe socket. (#5606)
1 parent dd5df5c commit 04b90d6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/TcpServer.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
use Hyperf\RpcMultiplex\Exception\Handler\DefaultExceptionHandler;
2626
use Hyperf\RpcServer\RequestDispatcher;
2727
use Hyperf\RpcServer\Server;
28+
use Hyperf\Server\Connection as HyperfConnection;
2829
use Hyperf\Server\Exception\InvalidArgumentException;
2930
use Hyperf\Utils\Coroutine;
3031
use Multiplex\Contract\HasHeartbeatInterface as Heartbeat;
@@ -91,7 +92,7 @@ public function onReceive($server, int $fd, int $reactorId, string $data): void
9192
}
9293

9394
/**
94-
* @param Connection|SwooleServer $server
95+
* @param Connection|HyperfConnection|SwooleServer $server
9596
*/
9697
protected function send($server, int $fd, ResponseInterface $response): void
9798
{
@@ -101,7 +102,7 @@ protected function send($server, int $fd, ResponseInterface $response): void
101102

102103
if ($server instanceof SwooleServer) {
103104
$server->send($fd, $packed);
104-
} elseif ($server instanceof Connection) {
105+
} elseif ($server instanceof Connection || $server instanceof HyperfConnection) {
105106
$server->send($packed);
106107
}
107108
}

0 commit comments

Comments
 (0)