• Post Reply Bookmark Topic Watch Topic
  • New Topic

Client slow to process - help!

 
Susan Barretta
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a standalone client (non-browser) using an HttpUrlConnection to a Jakarta Tomcat 4.0 Servlet. From everything I can tell the servlet dutifully and frequently flushes after writing to the response writer,
yet
my client does not START processing any response until after the servlet is done processing the request.
In some cases, the response is text/xml, in other cases, it might be gzipped, but the end result is the same.
What is going on???
I am tearing my hair out on this - Java Sun forums have been unhelpful. I've tried tweaking setUseCaches to no avail.
 
Tim Holloway
Bartender
Posts: 18408
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Generally, an HTTP request was expected to be an "all or nothing" sort of thing - after all, you can't render a table until all the internal tags have been seen and the widths calculated. Some environments, such as Acrobat under Netscape even demand an accurate content-length header or they'll fail.
However, there are cases where this isn't so. For example, Acrobat supports incremental downloading, so you don't have to wait for the entire document to finish downloading before reading the first few pages.
HTTP allows for segmenting or partial transmissions (that is, at the HTTP level - stuff at the TCP/IP levels wouldn't help). I forget the exact name of the mechanism, but check the HTTP RFC and you should be able to track it down.
 
Susan Barretta
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim, thanks for the reference to HTTP.
It turns out the simplest fix was to upgrade to Sun Java 1.4 - NOW I am getting almost immediate processing on the client end. The problem has been the client's getInputStream() call on the HttpUrlConnection. It just wouldn't execute until the servlet was "done". Apparently this has been a "known issue" and it's been addressed.
Thanks again.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!