Join 4,000+ others and never miss out on new tips, tutorials, and more.
4.x is outdated, please check the latest version 22.x
Latest version:
pecl install openswoole-22.1.2
<?php Swoole\Server->protect(int $fd, bool $value = true)
The file descriptor ID that you want to protect from being closed from heartbeat checks.
Set to true
to stop the fd from being closed and set to false
to remove the protection from being closed.
If successful, true
is returned, otherwise false
.
Protect the $fd
(file descriptor) from being closed by the heartbeat check interval. Use $value
to set or remove this protected state from a client connection.