Swoole Server pause

Notice: ext-swoole is supported until v4.7.1, use ext-openswoole >= v4.7.1. Latest version: pecl install openswoole-4.10.0


Swoole\Server->pause(int $fd)



The file descriptor number of the client connection you want to pause



If success, it returns 'true', otherwise it returns false.


Pauses the data receiving for the specified $fd client.

Things to consider

  • After calling this method, the connection will be removed from the event loop and no more client data will be received
  • This method does not affect the processing of the send queue
  • When in SWOOLE_PROCESS mode, calling this method may still allow some data to be received before it is actually paused, which could trigger the onReceive event
  • This method is only really recommended to be used in SWOOLE_BASE mode

Checkout resume for how to restart the client connection.