Bug #62583 [NEW]: socket_read(, , PHP_BINARY_READ) never ruturns FALSE when client disconnects
| From: | zyss at mail dot zp dot ua | Date: | Mon, 16 Jul 2012 21:16:45 +0000 |
| Subject: | Bug #62583 [NEW]: socket_read(, , PHP_BINARY_READ) never ruturns FALSE when client disconnects | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-172019@lists.php.net to get a copy of this message | ||
From: zyss at mail dot zp dot ua
Operating system: Win32
PHP version: 5.3.14
Package: *General Issues
Bug Type: Bug
Bug description:socket_read(, , PHP_BINARY_READ) never ruturns FALSE when client disconnects
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 bug report at https://bugs.php.net/bug.php?id=62583&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=62583&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=62583&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=62583&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=62583&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=62583&r=needdocs
Fixed in release: https://bugs.php.net/fix.php?id=62583&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=62583&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=62583&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=62583&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=62583&r=support
Expected behavior: https://bugs.php.net/fix.php?id=62583&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=62583&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=62583&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=62583&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=62583&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=62583&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=62583&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=62583&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=62583&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=62583&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=62583&r=mysqlcfg