From ea07a0ea13a085e36705f1b89642cfae22071784 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E5=B0=8F=E6=98=8E?= <2966980@qq.com> Date: Sun, 30 Apr 2023 20:42:15 +0800 Subject: [PATCH] Increase timeout setting --- src/Eth.php | 5 +++-- src/Net.php | 5 +++-- src/Personal.php | 5 +++-- src/Shh.php | 5 +++-- src/Web3.php | 5 +++-- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/Eth.php b/src/Eth.php index 78d97989..e52ef9ab 100644 --- a/src/Eth.php +++ b/src/Eth.php @@ -45,14 +45,15 @@ class Eth * construct * * @param string|\Web3\Providers\Provider $provider + * @param int $timeout * @return void */ - public function __construct($provider) + public function __construct($provider, $timeout = 1) { if (is_string($provider) && (filter_var($provider, FILTER_VALIDATE_URL) !== false)) { // check the uri schema if (preg_match('/^https?:\/\//', $provider) === 1) { - $requestManager = new HttpRequestManager($provider); + $requestManager = new HttpRequestManager($provider, $timeout); $this->provider = new HttpProvider($requestManager); } diff --git a/src/Net.php b/src/Net.php index bb06615d..c4d24f44 100644 --- a/src/Net.php +++ b/src/Net.php @@ -45,14 +45,15 @@ class Net * construct * * @param string|\Web3\Providers\Provider $provider + * @param int $timeout * @return void */ - public function __construct($provider) + public function __construct($provider, $timeout = 1) { if (is_string($provider) && (filter_var($provider, FILTER_VALIDATE_URL) !== false)) { // check the uri schema if (preg_match('/^https?:\/\//', $provider) === 1) { - $requestManager = new HttpRequestManager($provider); + $requestManager = new HttpRequestManager($provider, $timeout); $this->provider = new HttpProvider($requestManager); } diff --git a/src/Personal.php b/src/Personal.php index 75aa200c..39221bd2 100644 --- a/src/Personal.php +++ b/src/Personal.php @@ -45,14 +45,15 @@ class Personal * construct * * @param string|\Web3\Providers\Provider $provider + * @param int $timeout * @return void */ - public function __construct($provider) + public function __construct($provider, $timeout = 1) { if (is_string($provider) && (filter_var($provider, FILTER_VALIDATE_URL) !== false)) { // check the uri schema if (preg_match('/^https?:\/\//', $provider) === 1) { - $requestManager = new HttpRequestManager($provider); + $requestManager = new HttpRequestManager($provider, $timeout); $this->provider = new HttpProvider($requestManager); } diff --git a/src/Shh.php b/src/Shh.php index bc438e4b..624a9100 100644 --- a/src/Shh.php +++ b/src/Shh.php @@ -46,14 +46,15 @@ class Shh * construct * * @param string|\Web3\Providers\Provider $provider + * @param int $timeout * @return void */ - public function __construct($provider) + public function __construct($provider, $timeout = 1) { if (is_string($provider) && (filter_var($provider, FILTER_VALIDATE_URL) !== false)) { // check the uri schema if (preg_match('/^https?:\/\//', $provider) === 1) { - $requestManager = new HttpRequestManager($provider); + $requestManager = new HttpRequestManager($provider, $timeout); $this->provider = new HttpProvider($requestManager); } diff --git a/src/Web3.php b/src/Web3.php index 35a2cded..3854c53b 100644 --- a/src/Web3.php +++ b/src/Web3.php @@ -85,14 +85,15 @@ class Web3 * construct * * @param string|\Web3\Providers\Provider $provider + * @param int $timeout * @return void */ - public function __construct($provider) + public function __construct($provider, $timeout = 1) { if (is_string($provider) && (filter_var($provider, FILTER_VALIDATE_URL) !== false)) { // check the uri schema if (preg_match('/^https?:\/\//', $provider) === 1) { - $requestManager = new HttpRequestManager($provider); + $requestManager = new HttpRequestManager($provider, $timeout); $this->provider = new HttpProvider($requestManager); }