PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

connection_status> <その他の関数
Last updated: Fri, 05 Sep 2008

view this page in

connection_aborted

(PHP 4, PHP 5)

connection_abortedクライアントとの接続が切断されているかどうかを調べる

説明

int connection_aborted ( void )

クライアントとの接続が切断されているかどうかを調べます。

返り値

クライアントとの接続が切断されている場合に 1、それ以外の場合に 0 を返します。

参考



connection_status> <その他の関数
Last updated: Fri, 05 Sep 2008
 
add a note add a note User Contributed Notes
connection_aborted
Terbaddo
09-May-2008 06:19
To use less resource:
<?php
if(connection_aborted)
exit;
?>
phpcoder at cyberpimp dot techlab dot info
28-Jun-2007 02:50
Although the documentation indicates it returns an int, I found comparing the return value with numeric values does not seem to work.

Example (does not work):
<?php
if (connection_aborted()==1) {
fwrite($filehandle, 'aborted!');
}
?>

You're better off just assuming it returns boolean

Example (does work):
<?php
if (connection_aborted()) {
fwrite($filehandle, '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

connection_status> <その他の関数
Last updated: Fri, 05 Sep 2008
 
 
show source | credits | sitemap | contact | advertising | mirror sites