Hello Oleg,
Thanks for the suggestions. Will you be able to share some further thoughts on 
the following scenario/questions:
At the CLIENT side, I'm expecting the message exchange to look like this:
CLIENT -> Sends HTTP POST Request
SERVER-> Returns a 200/OK Response
CLIENT-> Starts POLLING the connection for future responses
SERVER-> Sends one or more HTTP responses, and keeps sending until the CLIENT 
sends a HTTP Request asking to CLOSE the session


Now, (from my knowledge of using HTTP Client), 
Q:      How will the client actually POLL the connection after receiving the 
first HTTP 200/OK response? What's the code snippet would look like for the 
CLIENT to be able to read from the SOCKET after it uses/consumes from the 
Entity Input Stream to read the first HTTP Response (200/OK)?
Q:      If I use HTTPClient, is there a way to achieve the above Polling i.e. 
actually reading further responses, since I can use a Poller/Timer action from 
a single thread in my existing code with HTTPClient.
Basically I'm not able to understand/visualize the sequence of steps for 
actually be to read/receive response from connection, after the first response 
is received against the HTTP Request.
Any suggestions will be extremely helpful.
Regards,
- Sujit 





> Subject: Re: Need advice on using an appropriate starting point
> From: [email protected]
> To: [email protected]
> Date: Fri, 10 Sep 2010 17:23:06 +0200
> 
> On Thu, 2010-09-09 at 14:35 +0000, Sujit Basu wrote:
> > Hi,
> > I'm developing a HTTP Client application with some key requirements, which 
> > are as following (I'm also putting some inline notes/questions):
> > 1. HTTPS with mutual SSL Authentication using certificates.Note: I have 
> > used Commons HttpClient v4.0.1 successfully in the recent past to do this 
> > type of SSL Certificate Authentication.
> > 2. Use a single persistent HTTPS connectionQ: Using a connection manager 
> > with max connection=1 is better than using a no explicit connection manager?
> 
> It depends. If you want to have no more than connection per host but
> intend to access those hosts concurrently from multiple threads you
> should be using a pooling connection manager. If you want no more than
> one connection at any point of time, the default connection manager is
> your best choice.
> 
> 
> > 3. The client needs to poll the connection to check for new responses. The 
> > server will be using a COMET type message exchange, where it can push 
> > message to the client, without receiving an explicit request from the 
> > client.Q: Is HttpCore NIO is a good starting point to build this 
> > functionality? Q: Is there a way for HttpClient to poll the connection for 
> > new responses?
> > Any suggestion/advice for a good starting point HttpClient/HttpCore? and 
> > even Sample code (particularly for HttpCore NIO, if suggested) will be 
> > highly appreciated.
> 
> HttpCore NIO should probably the best starting point. You must be
> prepared to write custom protocol handlers, though. Examples of standard
> HTTP protocol handlers can be found here:
> 
> http://hc.apache.org/httpcomponents-core-ga/examples.html
> 
> HttpCore tutorial can be found here: 
> 
> http://hc.apache.org/httpcomponents-core-ga/tutorial/html/index.html
> 
> Hope this helps
> 
> Oleg
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 
                                          

Reply via email to