From c903af0d1954c624a9f88ddaaaa40b67edeac351 Mon Sep 17 00:00:00 2001 From: Danilin Evgenii Date: Thu, 11 Apr 2024 19:29:40 +0400 Subject: [PATCH] fix socket timeout --- src/Client/SocketClient.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Client/SocketClient.php b/src/Client/SocketClient.php index f770d54..98650ac 100644 --- a/src/Client/SocketClient.php +++ b/src/Client/SocketClient.php @@ -39,12 +39,12 @@ public function connect(): void STREAM_CLIENT_CONNECT, $context ); - stream_set_timeout($this->socket, $this->timeout); if ($socket === false) { throw new ClientConnectionException( sprintf('Cannot establish connection: [%d] %s', $errorCode, $errorMessage) ); } + stream_set_timeout($this->socket, $this->timeout); $this->socket = $socket; } }