超越PHP PHP动态 | 经典文章 | CLASS | 相关下载 | 常见问题 | FORUM | WIKI | 在线手册
Site search:    
<Misc.connection_status>
Last updated: Fri, 22 Jun 2007

connection_aborted

(PHP 3>= 3.0.7, PHP 4 , PHP 5)

connection_aborted -- Returns TRUE if client disconnected

Description

int connection_aborted ( void )

Returns TRUE if client disconnected. See the Connection Handling description in the Features chapter for a complete explanation.

See also connection_status(), and ignore_user_abort().




add a note add a note User Contributed Notes
connection_aborted
rickyale at ig dot com dot br
14-Dec-2002 08:29
I know why nobody can use the functions connection_XXX(). If the php code do not send anything to buffer, the php dont check the connection, so, the connection_timeout will still NORMAL and will not be ABORTED.

Ex

<?php
Set_Time_Limit(0);  //this you know what gonna do
Ignore_User_Abort(True); //this will force the script running at the end

While(!Connection_Aborted()) {
  Echo "\n"; //this will save de while
  Flush(); //Now php will check de connection
   While(CONDITION) {
       Echo "My chat....";
   }
Sleep(1);
}
?>

end

<Misc.connection_status>
 Last updated: Fri, 22 Jun 2007
view source | feedback | send page | sitemap | aboutus   
Copyright ® 2002-2003 PHPE.NET. All rights reserved
Last updated:2002-11-22