PHP sleep function and client connections

How does PHP handle client connection during sleep?

Or in another way: what happens if the client closes the connection to the server during page processing?

Does it just kill the process or continue to process the page to the end?

Since I'm not sure about the answers to the above, how would I implement the following pseudo-code in PHP.

Record user entered while (user is still connected) { fetch changes in state since last awake send changes to user sleep(5); } Record user exit 

Any thoughts would be appreciated.

Thanks.

+4
source share
1 answer

Who knew

Connection Connection Documentation - http://php.net/manual/en/features.connection-handling.php

From this register_shutdown_function page, the problem is solved.

Wonderful.

+2
source

All Articles