This commit is contained in:
xl
2023-05-26 09:20:30 +08:00
parent 18a9b29bbd
commit 493a58281f
+1 -1
View File
@@ -87,7 +87,7 @@ class ClientPool extends Component
public function getPool($host, $port): Pool public function getPool($host, $port): Pool
{ {
$pool = Kiri::getDi()->get(Pool::class); $pool = Kiri::getDi()->get(Pool::class);
$pool->initConnections($host . '::' . $port, 10, function () use ($host, $port) { $pool->created($host . '::' . $port, 10, function () use ($host, $port) {
$client = stream_socket_client("tcp://$host:$port", $errCode, $errMessage, 3); $client = stream_socket_client("tcp://$host:$port", $errCode, $errMessage, 3);
if ($client === false) { if ($client === false) {
throw new Exception('Connect ' . $host . '::' . $port . ' fail'); throw new Exception('Connect ' . $host . '::' . $port . ' fail');