On Fri, Nov 18, 2011 at 10:02:01PM +0200, Aekold Helbrass wrote:
> On Fri, Nov 18, 2011 at 5:36 PM, Oleg Kalnichevski <[email protected]> wrote:
> > On Fri, Nov 18, 2011 at 12:04:19PM +0200, Aekold Helbrass wrote:
> >> Hi All!
> >>
> >> In short, my question is: is it possible to create data dialog in
> >> single HTTP request? I mean I am reading first 10 bytes - sending
> >> something in response, client reacts and sens 10 more bytes, and all
> >> that in single HTTP request, without breaking or closing it. I am
> >> interested in server side, as client side is plain sockets on
> >> blackberry. It is highly-specialized server for single task, so
> >> general cases and "normal cases" are ignored.
> >>
> >> To be honest - I have absolutely no idea if HTTP specification allows
> >> something like this at all, and couldn't find relevant info.
> >>
> >
> > No, it does not. HTTP is a request / response based protocol. What you are 
> > talking about sounds very much like Websockets or a similar protocol.
> 
> And what about server push? Can it be done with HTTP Components, so I
> could initiate dialog from the server side instead of processing
> client requests every N seconds?
> 

HTTP servers cannot establish connections with clients. This is against the 
nature of the HTTP protocol, which is a client / server and not a peer to peer 
protocol. HTTP clients are expected to open a connection to the HTTP server and 
send a request before the server could start sending data back to the client. 
One can simulate server push by sending data in chunks using the so called 
chunked transfer coding. This kind of scenario is certainly double with 
HttpCore NIO.

Oleg

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to