diff --git a/Request/Requester/CurlRequester.php b/Request/Requester/CurlRequester.php index 0eb0ce3..0336653 100644 --- a/Request/Requester/CurlRequester.php +++ b/Request/Requester/CurlRequester.php @@ -18,6 +18,11 @@ class CurlRequester extends AbstractRequester */ private $sslVersion = 1; + /** + * @var int + */ + private $curlConnectTimeout = 300; + /** * @param int $sslVersion */ @@ -25,6 +30,14 @@ public function setSSLVersion($sslVersion) { $this->sslVersion = $sslVersion; } + + /** + * @param int $timeout + */ + public function setCurlConnectTimeout($timeout) + { + $this->curlConnectTimeout = $timeout; + } /** * @param AbstractRequest $request @@ -40,6 +53,7 @@ protected function request(AbstractRequest $request) $handler = curl_init($request->getUrl()); + curl_setopt($handler, CURLOPT_CONNECTTIMEOUT, $this->curlConnectTimeout); curl_setopt($handler, CURLOPT_POST, true); curl_setopt($handler, CURLOPT_POSTFIELDS, $request->getData());