in reply to How to close connection to browser

Couldn't you just flush the buffer?