defaultMaxSendBufferSize
Description:
static int Connection::$defaultMaxSendBufferSize
This property is a global static property that is used to set the default application layer send buffer size for all connections. If not set, the default value is 1MB. The value of Connection::$defaultMaxSendBufferSize can be dynamically set and the new value will only take effect for connections established after the setting.
This property impacts the onBufferFull callback.
Example
use Workerman\Worker;
use Workerman\Connection\TcpConnection;
require_once __DIR__ . '/vendor/autoload.php';
// Set the default application layer send buffer size for all connections
TcpConnection::$defaultMaxSendBufferSize = 2*1024*1024;
$worker = new Worker('websocket://0.0.0.0:8484');
$worker->onConnect = function(TcpConnection $connection)
{
// Set the application layer send buffer size for the current connection, which will override the default value
$connection->maxSendBufferSize = 4*1024*1024;
};
// Run the worker
Worker::runAll();