OpenSwoole Server protect()

Latest version: pecl install openswoole-22.1.2 | composer require openswoole/core:22.1.5

Declaration

<?php OpenSwoole\Server->protect(int $fd, bool $value = true)

Parameters

fd

The file descriptor ID that you want to protect from being closed from heartbeat checks.

value

Set to true to stop the fd from being closed and set to false to remove the protection from being closed.

Return

success

If successful, true is returned, otherwise false.

Description

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.

Last updated on September 1, 2022