|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62583 socket_read(, , PHP_BINARY_READ) never ruturns FALSE when client disconnects
Submitted: 2012-07-16 21:16 UTC Modified: -
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: zyss at mail dot zp dot ua Assigned:
Status: Open Package: *General Issues
PHP Version: 5.3.14 OS: Win32
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2012-07-16 21:16 UTC] zyss at mail dot zp dot ua
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:

Test script:

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...


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Jul 28 20:01:23 2021 UTC