本文整理匯總了PHP中HttpSocket::read方法的典型用法代碼示例。如果您正苦於以下問題:PHP HttpSocket::read方法的具體用法?PHP HttpSocket::read怎麽用?PHP HttpSocket::read使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類HttpSocket
的用法示例。
在下文中一共展示了HttpSocket::read方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: read
/**
* Read data from the socket. Returns false if no data is available or no connection could be
* established.
*
* @param integer $length Optional buffer length to read; defaults to 1024
* @return mixed Socket data
*/
public function read($length = 1024)
{
/*if(!$this->_handshake) return parent::read($length);
if(!$this->_transport) {
$read = array($this->connection);
$write = null;
$except = null;
if(stream_select($read, $write, $except, $this->config['timeout'])) {
dd(parent::read($length));
}
dd($select);
//return fread($this->connection, $length);
}*/
$data = parent::read($length);
if ($data && $this->_transport) {
$data = $this->decode($data);
}
return $data;
}