File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ class Socket extends AConnection
2121 private $ socket = false ;
2222
2323 private const POSSIBLE_TIMEOUTS_CODES = [11 , 10060 ];
24+ private const POSSIBLE_RETRY_CODES = [4 , 10004 ];
2425
2526 public function connect (): bool
2627 {
@@ -81,7 +82,7 @@ public function read(int $length = 2048): string
8182 throw new ConnectionTimeoutException ('Read from connection reached timeout after ' . $ this ->timeout . ' seconds. ' );
8283 $ readed = @socket_read ($ this ->socket , $ length - mb_strlen ($ output , '8bit ' ));
8384 if ($ readed === false ) {
84- if (socket_last_error ($ this ->socket ) === 10004 )
85+ if (in_array ( socket_last_error ($ this ->socket ), self :: POSSIBLE_RETRY_CODES , true ) )
8586 continue ;
8687 $ this ->throwConnectException ();
8788 }
You can’t perform that action at this time.
0 commit comments