Bug #62583 [Fbk->NoF]: socket_read(, , PHP_BINARY_READ) never returns FALSE when client disconnects
| From: | php-bugs at lists dot php dot net | Date: | Sun, 19 Sep 2021 04:22:08 +0000 |
| Subject: | Bug #62583 [Fbk->NoF]: socket_read(, , PHP_BINARY_READ) never returns FALSE when client disconnects | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-236689@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=62583&edit=1
ID: 62583
Updated by: php-bugs@lists.php.net
Reported by: zyss at mail dot zp dot ua
Summary: socket_read(, , PHP_BINARY_READ) never returns FALSE
when client disconnects
-Status: Feedback
+Status: No Feedback
Type: Bug
Package: Sockets related
Operating System: Win32
PHP Version: 5.3.14
Assigned To: cmb
Private report: N
New Comment:
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
Previous Comments:
------------------------------------------------------------------------
[2021-09-09 14:14:36] cmb@php.net
Is this still an issue with any of the actively supported PHP
versions[1]?
[1] <https://www.php.net/supported-versions.php>
------------------------------------------------------------------------
[2012-07-16 21:16:45] zyss at mail dot zp dot ua
Description:
------------
It seems that there is a long-lasting bug in PHP that prevents socket_read (called on a server-side
socket returned from socket_accept()) to return false when TCP connection is closed (no matter how -
gracefully or not).
Here this bug is mention also: http://stackoverflow.com/questions/9085615/php-detecting-remote-host-disconnection
Test script:
---------------
https://github.com/zyura/PHPSrv/blob/master/tcpserver.php
Expected result:
----------------
socket_read() returns FALSE when client disconnects and socket_last_error() returns adequate error
code.
Actual result:
--------------
when client disconnects socket_read() always return empty string '' keeping client socket
forever...
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=62583&edit=1