onBufferFull
最后更新于:2022-04-02 06:24:11
# onBufferFull
当缓存区达到最高水位时触发此事件。
~~~
function onBufferFull(Swoole\Server $serv, int $fd);
~~~
* 设置`server->buffer_high_watermark`选项来控制缓存区高水位线,单位为字节
* 触发`onBufferFull`表明此连接`$fd`的发送队列已触顶即将塞满,这时不应当再向此`$fd`发送数据
~~~
$server->set([
'buffer_high_watermark' => 8 * 1024 * 1024,
]);
$server->on('onBufferFull', function ($serv, $fd) {
});
~~~
';