If the iterable returned by the application has a close() method, the server or gateway must call that method upon completion of the current request, whether the request was completed normally, or terminated early due to an error.
So if close()
is called before the output iterator has finished, you know client was disconnected.