Skip to content

Commit ea79096

Browse files
committed
Move connection timeout to constant
1 parent 94dc6c3 commit ea79096

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Punkstar/Ssl/Reader.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
class Reader
66
{
7+
const CONNECTION_TIMEOUT = 30;
78

89
/**
910
* @param $url
@@ -26,7 +27,7 @@ public function readFromUrl($url)
2627
)
2728
));
2829

29-
$stream = @stream_socket_client("ssl://" . $urlHost . ":443", $errorNumber, $errorString, 30, STREAM_CLIENT_CONNECT, $streamContext);
30+
$stream = @stream_socket_client("ssl://" . $urlHost . ":443", $errorNumber, $errorString, self::CONNECTION_TIMEOUT, STREAM_CLIENT_CONNECT, $streamContext);
3031

3132
if ($stream) {
3233
$streamParams = stream_context_get_params($stream);

0 commit comments

Comments
 (0)