Created
August 24, 2016 09:09
-
-
Save john77eipe/9d8958e743ec01d45aec367f3007677f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// tell the browser if connection | |
// fails to reopen it after 10 seconds | |
response.getWriter().println("retry: 10000\n"); | |
// Start asynchronous context and add listeners to remove it in case | |
// of errors | |
final AsyncContext ac = request.startAsync(); | |
log("Default timeout for this asyncContext: "+ac.getTimeout()); | |
// The timeout will expire if neither the complete() method nor any of the dispatch methods are called on the | |
// asyncContext. | |
// this value times out the connection | |
ac.setTimeout(Integer.MAX_VALUE); | |
log("Changed timeout for this asyncContext: "+ac.getTimeout()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment