請(qǐng)問下 stream_select 這個(gè)作用是什么,網(wǎng)上找不到相關(guān)資料
while (1)
{
$read = $this->_readFds;
$write = $this->_writeFds;
// 等待可讀或者可寫事件
stream_select($read, $write, $e, 0, $this->_selectTimeout);
// 嘗試執(zhí)行定時(shí)任務(wù)
if(!$this->_scheduler->isEmpty())
{
$this->tick();
}
// 這些描述符可讀,執(zhí)行對(duì)應(yīng)描述符的讀回調(diào)函數(shù)
if($read)
{
foreach($read as $fd)
{
$fd_key = (int) $fd;
if(isset($this->_allEvents))
{
call_user_func_array($this->_allEvents, array($this->_allEvents));
}
}
}
// 這些描述符可寫,執(zhí)行對(duì)應(yīng)描述符的寫回調(diào)函數(shù)
if($write)
{
foreach($write as $fd)
{
$fd_key = (int) $fd;
if(isset($this->_allEvents))
{
call_user_func_array($this->_allEvents, array($this->_allEvents));
}
}
}
}
2個(gè)回答
年代過于久遠(yuǎn),無法發(fā)表回答