maxSendBufferSize

说明:

  1. int Connection::$maxSendBufferSize

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

此属性影响onBufferFull回调

范例

  1. use Workerman\Worker;
  2. use Workerman\Connection\TcpConnection;
  3. require_once __DIR__ . '/Workerman/Autoloader.php';
  4. $worker = new Worker('websocket://0.0.0.0:8484');
  5. $worker->onConnect = function($connection)
  6. {
  7. // 设置当前连接的应用层发送缓冲区大小为102400字节
  8. $connection->maxSendBufferSize = 102400;
  9. };
  10. // 运行worker
  11. Worker::runAll();