PHP/Utility Function/connection status — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 07:08, 26 мая 2010
int connection_status ( void ) returns 0 if the connection is live;
1 if the connection is aborted; 2 if the connection has been aborted; and 3 if the connection has been aborted and subsequently timed out.
<?
function say_goodbye( ) {
if (connection_status( ) = = CONNECTION_TIMEOUT) {
print "Script timeout!\n";
} else {
print "Goodbye!\n";
}
}
register_shutdown_function("say_goodbye");
set_time_limit(1);
print "Sleeping...\n";
sleep(2);
print "Done!\n";
?>