Skip to content
This repository was archived by the owner on Oct 30, 2024. It is now read-only.

Commit 8637b3e

Browse files
committed
BUGFIX: Without calling stream_set_timeout the timeout is not respected
1 parent bae588e commit 8637b3e

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/StreamWrapper.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ class StreamWrapper
1616
* @param integer $timeout Timeout.
1717
* @param integer $typeStream Type of stream.
1818
*
19-
* @return stream
19+
* @return resource
2020
*/
2121
public function getStreamSocketClient($address, &$errno, &$errstr, $timeout, $typeStream)
2222
{
23-
return stream_socket_client($address, $errno, $errstr, $timeout, $typeStream);
23+
$stream = stream_socket_client($address, $errno, $errstr, $timeout, $typeStream);
24+
stream_set_timeout($stream, $timeout);
25+
return $stream;
2426
}
2527

2628
/**

0 commit comments

Comments
 (0)