ID: 37129 User updated by: devrjason at gmail dot com Reported By: devrjason at gmail dot com Status: Bogus Bug Type: Scripting Engine problem Operating System: Windows_NT PHP Version: 5.1.2 New Comment:
PHP generally runs on the same machine as the webserver is running. It knows the remote host, why can't it pole TCP connections and figure out when the remote host no longer exists in the list? Perhaps that sounds a bit outlandish, but I find it quite ridiculous that web servers can't tell CGIs little important details like that, since the CGI runs on the same machine. Grrr... Previous Comments: ------------------------------------------------------------------------ [2006-04-18 21:24:49] [EMAIL PROTECTED] PHP knows that the connectio was aborted only if it tries to write something to the buffer and fails. If you don't write anything to the buffer/screen - there is no way for PHP to know that. ------------------------------------------------------------------------ [2006-04-18 21:21:38] devrjason at gmail dot com Description: ------------ Looks like bug #17265 broke again, but I was unable to add a comment to it since it's closed. This code doesn't stop running when the page is aborted. Reproduce code: --------------- $mcon = mysql_connect("localhost", "root", "*****") or die("mysql connect failed"); while (1) { sleep(3); $status = connection_status(); @mysql_query("insert into test.tests set charv='Connection status: $status'",$mcon); $status = connection_aborted(); @mysql_query("insert into test.tests set charv='Connection aborted: $status'",$mcon); } Expected result: ---------------- No more entries after script is aborted. Actual result: -------------- Script continues making entries until it times out. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=37129&edit=1