On Friday, October 17, 2003, at 10:03 AM, James Manning wrote:


It signals the end of a given GET or POST with a special
sequence of characters, for which you need scan in your code.

AFAIK, no - you get the Content-length header that tells you how much to read as the body of the request. The open socket is waiting for the HTTP response, which after reading content-length bytes (could be 0), you should (acting as the http server) provide.


Not all HTTP replies contain a Content-length header. The problem is browsers in general are VERY forgiving of bad HTTP, and people write servlet code that sends out bogus HTTP, and then expect your code to parse it because the browser can handle it.


There's some nice sample code for parsing HTTP in the book Java Network Programming by local programmers Huges, Merlin, and Conrad.


As an aside, HttpClient from Jakarta Commons is great when you want to
act like a web browser, but it doesn't take care of acting like a web
server.  Is there something (ideally in a commons-ish area, not tied
to a particular full implementation) out there like that?

The problem with the client libraries I've seen is they allocate way too many Strings and other objects. It works fine if there's only one, but once you get in a server situation and want to scale the allocations will kill performance. We've had to write all of our own I/O code.


--------------------------------
Michael Czeiszperger
http://webperformanceinc.com
Website Load Testing, Stress Testing, and Performance Monitoring Software



_______________________________________________ Juglist mailing list [EMAIL PROTECTED] http://trijug.org/mailman/listinfo/juglist_trijug.org

Reply via email to