PHP 8.5.0 Alpha 4 available for testing

Voting

: min(zero, zero)?
(Example: nine)

The Note You're Voting On

Arvy
7 years ago
On non-blocking sockets, the function will return "" if no data is received, and even if the client disconnects.

If you want to check if the client disconnected, use ===.

$ret=socket_read($socket);

$ret=="" : connected but no data received or client disconnected
$ret==="" : client disconnected for sure

<< Back to user notes page

To Top