Swoole Server protect

void Swoole\Server::protect ( int $fd [, boolean $is_protected ] )

Alias: swoole_server->protect( int $fd [, boolean $is_protected ] )

Protect the $fd from being closed by the thread of checking heart beat

Parameter

  • $fd the id number of client
  • $value if true, protect the $fd. If false, remove the protect from $fd
Return
Example