Home > PHP Framework > Swoole > How to use swoole to monitor whether the client is disconnected

How to use swoole to monitor whether the client is disconnected

Release: 2019-12-17 09:53:19
Original
3282 people have browsed it

How to use swoole to monitor whether the client is disconnected

$fd in swoole is the identifier of the TCP client connection, which is unique in the Server instance and will not be repeated in multiple processes.

Check whether the connection corresponding to fd exists.

function Server->exist(int $fd) : bool;
Copy after login

$fd returns true if the corresponding TCP connection exists, false if it does not exist

This interface is based on shared memory calculations and does not have any IO operations

Server->exist Available in version 1.7.18 or above

Recommended learning: swoole video tutorial

The above is the detailed content of How to use swoole to monitor whether the client is disconnected. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template