EventBufferEvent::getInput
(PECL event >= 1.2.6-beta)
EventBufferEvent::getInput — Returns underlying input buffer associated with current buffer event
說明
Returns underlying input buffer associated with current buffer event. An input buffer is a storage for data to read.
Note, there is also
input
property of
EventBufferEvent
class.
參數
此函式沒有參數。
返回值
Returns instance of EventBuffer input buffer associated with current buffer event.
範例
示例 #1 Buffer event's read callback
<?php
function readcb($bev, $base) {
$input = $bev->input; //$bev->getInput();
while (($n = $input->remove($buf, 1024)) > 0) {
echo $buf;
}
}
?>
參見
- EventBufferEvent::getOutput() - Returns underlying output buffer associated with current buffer event