lithium\net\socket\Stream::timeout PHP Метод

timeout() публичный Метод

Set timeout period on a stream.
public timeout ( integer $time ) : boolean
$time integer The timeout value in seconds.
Результат boolean
    public function timeout($time)
    {
        if (!is_resource($this->_resource)) {
            return false;
        }
        return stream_set_timeout($this->_resource, $time);
    }

Usage Example

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