WorkerMan 3.x 手册

maxSendBufferSize

说明:

int Connection::$maxSendBufferSize

此属性用来设置当前连接的应用层发送缓冲区大小。不设置默认为Connection::$defaultMaxSendBufferSize(1MB)。Connection::$maxSendBufferSizeConnection::$defaultMaxSendBufferSize均可以动态设置。

此属性影响onBufferFull回调

范例

use Workerman\Worker;
use Workerman\Connection\TcpConnection;
require_once __DIR__ . '/Workerman/Autoloader.php';

$worker = new Worker('websocket://0.0.0.0:8484');
$worker->onConnect = function($connection)
{
    // 设置当前连接的应用层发送缓冲区大小为102400字节
    $connection->maxSendBufferSize = 102400;
};
// 运行worker
Worker::runAll();