Voting

: six plus zero?
(Example: nine)

The Note You're Voting On

Arvy
6 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