lithium\net\socket\Curl::timeout PHP Method

timeout() public method

Note: A value of 0 may be used to specify an indefinite wait time.
public timeout ( integer $time ) : boolean
$time integer The timeout value in seconds
return boolean False if the resource handle is unavailable or the option could not be set, true otherwise.
    public function timeout($time)
    {
        if (!is_resource($this->_resource)) {
            return false;
        }
        return curl_setopt($this->_resource, CURLOPT_CONNECTTIMEOUT, $time);
    }

Usage Example

Example #1
0
	public function testTimeout() {
		$stream = new Curl($this->_testConfig);
		$result = $stream->open();
		$stream->timeout(10);
		$result = $stream->resource();
		$this->assertTrue(is_resource($result));
	}
All Usage Examples Of lithium\net\socket\Curl::timeout