Skip to content
This repository has been archived by the owner on Sep 1, 2020. It is now read-only.

Latest commit

 

History

History
21 lines (14 loc) · 486 Bytes

2.6.10 - onBufferFull.md

File metadata and controls

21 lines (14 loc) · 486 Bytes

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) {

});