Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Question on Buffer Flushing  RSS feed

 
Robert Paris
Ranch Hand
Posts: 585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my servlet I'm doing this:

In Internet Explorer 5.5 (and using Tomcat 3.2.3) this works perfectly and the browser prints the numbers as they're sent to it. So the page does:
10
(then a pause)
9
(then a pause)
8
etc.
they see the numbers appear on their page as they are flushed into the response buffer. My question is this:
Is this guaranteed to work for every http 1.0 or 1.1 browser? Is this guaranteed to work for every Servlet 2.2+ Engine?
This is exactly the functionality I want, but I have to be sure it works everywhere and doesn't cause the page to just return after the first flush and ignore the rest. Does anyone know?
Thanks!
 
Bhupinder Dhillon
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It'll work work the same everytime b/c you're not closing the output stream to client, you're only flushing the output.
 
Robert Paris
Ranch Hand
Posts: 585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, but maybe not. Is it in the HTTP Spec that when the sender flushes the responses you have to display it and keep the connection open until the connection is timed out or explicitly closed? That's really my question. Because, otherwise, there might be a browser that buffers everything and shows nothing until the connection's explicitly closed. Do you know for CERTAIN that this will not occur?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!