Skip to content

Commit

Permalink
fix socket timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
danilin-em committed Apr 11, 2024
1 parent 26d6413 commit 63d72cc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"homepage": "https://github.com/danilin-em/test-memcached-lib",
"require": {
"php": "^8.3",
"php": "^8.0",
"ext-mbstring": "*"
},
"require-dev": {
Expand Down
2 changes: 1 addition & 1 deletion src/Client/SocketClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 63d72cc

Please sign in to comment.