Skip to content

Commit f9dc287

Browse files
committed
added a second code to deteck timeout in socket
1 parent cb33d68 commit f9dc287

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/connection/Socket.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Socket extends AConnection
2121
*/
2222
private $socket = false;
2323

24-
private const RESOURCE_UNAVAILABLE_CODE = 11;
24+
private const RESOURCE_UNAVAILABLE_CODE = [11, 10060];
2525
/** @var float|null */
2626
private $timetAtTimeoutConfiguration;
2727

@@ -148,7 +148,7 @@ private function configureTimeout(): void
148148
private function throwConnectException(): void
149149
{
150150
$code = socket_last_error($this->socket);
151-
if ($code === self::RESOURCE_UNAVAILABLE_CODE) {
151+
if (in_array($code, self::RESOURCE_UNAVAILABLE_CODE)) {
152152
$timediff = microtime(true) - $this->timetAtTimeoutConfiguration;
153153
if ($timediff >= $this->timeout) {
154154
throw ConnectionTimeoutException::createFromTimeout($this->timeout);

0 commit comments

Comments
 (0)