hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kalnichevski, Oleg" <oleg.kalnichev...@bearingpoint.com>
Subject RE: How to get access to individual chunks in chunked response?
Date Thu, 13 Mar 2003 14:06:53 GMT

We have striven to make transfer encoding absolutely transparent to the client. We have never
envisaged direct access to individual chunks of chunk-encoded data. 

I may be wrong here, but let me express my personal opinion on this matter. Please bear in
mind HTTP protocol has been designed to be stateless, request/response oriented (with cookies
being a very clumsy attempt at adding session persistence later on). I doubt that HTTP protocol
is well suited for implementing any sort of notification channel. I suggest you reconsider
your design and probably use good ol' polling instead, rather than getting very creative with
the use of chunk encoding



-----Original Message-----
From: Fredrik Herbertsson [mailto:fredrik.herbertsson@om.com]
Sent: Donnerstag, 13. März 2003 13:27
To: commons-httpclient-dev@jakarta.apache.org
Subject: How to get access to individual chunks in chunked response?


Is it possible using HttpClient to get access to individual chunks in an chunked
Further, does the HTTP standard allow a HTTP-server to send MORE than one (full,
i.e. last chunk of size 0 sent) HTTP/1.1 200 responses for one request?

The problem I'm trying to solve is to make a request on a particular connection,
get a response (including data I need. In my case an application session id) and
then further wait for an application notification. The mentioned connection is a
notification channel used to notify client when certain application events

 I've been looking at the source for the ChunkedInputStream and as far as I can
see it is not possible to get hold of the chunks. (As it probably shouldn't be
since the stream is supposed to abstract stuff like that away :-). I only seem
ta have access to the full response. Is it possible to receive another (chunked)
response on the used InputStream? I't looks that the EOF flag is set when the
Last-Chunk is received and successive calls to read will immediately return -1,
making the stream useless for further responses. Is it possible to re-use the
connection (underlying Socket) and get a stream that reads from the same
underlying connection?

... or do I have to use 'raw' sockets on the client-side and parse the response
including the HTTP stuff :-(

/Fredrik Herbertsson

To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org

View raw message