本文整理汇总了PHP中SimpleTestCompatibility::setTimeout方法的典型用法代码示例。如果您正苦于以下问题:PHP SimpleTestCompatibility::setTimeout方法的具体用法?PHP SimpleTestCompatibility::setTimeout怎么用?PHP SimpleTestCompatibility::setTimeout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleTestCompatibility
的用法示例。
在下文中一共展示了SimpleTestCompatibility::setTimeout方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SimpleSocket
function SimpleSocket($host, $port, $timeout, $block_size = 255)
{
$this->SimpleStickyError();
if (!($this->_handle = $this->_openSocket($host, $port, $error_number, $error, $timeout))) {
$this->_setError("Cannot open [{$host}:{$port}] with [{$error}] within [{$timeout}] seconds");
return;
}
$this->_is_open = true;
$this->_block_size = $block_size;
SimpleTestCompatibility::setTimeout($this->_handle, $timeout);
}
示例2: SimpleSocket
/**
* Opens a socket for reading and writing.
* @param string $host Hostname to send request to.
* @param integer $port Port on remote machine to open.
* @param integer $timeout Connection timeout in seconds.
* @access public
*/
function SimpleSocket($host, $port, $timeout)
{
$this->StickyError();
$this->_is_open = false;
if (!($this->_handle = $this->_openSocket($host, $port, $error_number, $error, $timeout))) {
$this->_setError("Cannot open [{$host}:{$port}] with [{$error}] within [{$timeout}] seconds");
} else {
$this->_is_open = true;
SimpleTestCompatibility::setTimeout($this->_handle, $timeout);
}
}
示例3: __construct
/**
* Opens a socket for reading and writing.
* @param string $host Hostname to send request to.
* @param integer $port Port on remote machine to open.
* @param integer $timeout Connection timeout in seconds.
* @param integer $block_size Size of chunk to read.
* @access public
*/
function __construct($host, $port, $timeout, $block_size = 255)
{
parent::__construct();
if (!($this->handle = $this->openSocket($host, $port, $error_number, $error, $timeout))) {
$this->setError("Cannot open [{$host}:{$port}] with [{$error}] within [{$timeout}] seconds");
return;
}
$this->is_open = true;
$this->block_size = $block_size;
SimpleTestCompatibility::setTimeout($this->handle, $timeout);
}