On Tue, 2010-04-20 at 06:29 -0700, helxsz wrote:
>
> I am running a test on apache httpclient, once the httpclient sends to
> request to the server, a http streaming connection would be established, and
> also invokes a thread, which would sequentially broadcast data to the client
> every 2 seconds for 10 times in total
>
> On the client's side, I can see the connection is running during the long
> -polling period, but could not receive any data.. And I am sure it is
> streaming and chunked
>
> public Object handleResponse(HttpResponse response)
> {
>
> HttpEntity entity = response.getEntity();
>
> System.out.println("isStreaming:" +
> response.getEntity().isStreaming());
> // true
> System.out.println("isChunked:" +
> response.getEntity().isChunked());
> // true
> System.out.println("isrepeatable:" +
> response.getEntity().isRepeatable()); // false
>
>
> if (entity != null) {
> System.out.println("Response content length: " +
> entity.getContentLength());
> BufferedReader reader = new BufferedReader(new
> InputStreamReader(entity.getContent()));
> while(reader.readLine()!=null)
> {
> System.out.println(reader.readLine());
> }
> } // this doesn't seem to work out
> return null;
> }
> };
> httpclient.execute(httpget, responseHandler);
>
> I wonder as for receiving data from a http streaming, chunked connection,
> probably the solution is to use ChunkedInputStream , but I can't find a
> tutorial for this class
>
> Or if I am wrong , who could help me how to receive data from a
> streaming, chunked connection??
>
Post wire log of the HTTP session
http://hc.apache.org/httpcomponents-client-4.0.1/logging.html
Oleg
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]