>> I want to use a servlet layer at the backend, because my client will
>> almost definitely be behind a firewall/using a proxy server (I will
[quoted text clipped - 8 lines]
>
> did you look at SOAP?
Yeah. Sorry, I should have mentioned that I did not want to use SOAP
because of all the "weight" of the XML payload and also the extra XML
procesing required on both ends. I want this to be as lightweight as I
can get away with (securely).
>> Additionaly, I have not entirely worked out how I can "force" certain
>> requests (i.e. SynchRequests) to be blocking. I have some ideas, but
[quoted text clipped - 3 lines]
> well, http is actually synchronous, so your problem should be to do that
> non blocking
My bad. I should have read what I was typing before I sent the post ;-).
You are entirely right - the problem is to make the calls asynch. I have
ideas about how to do it - an obvious one would be spawning a new thread
which actually executes the HTTPRequest command, returning to the user
and then calling back the callee when the data arrives/times out etc,
but I wanted to know if there is another (more elegant?) way.
>> Lastly, whilst all this request/response is going on, I want to be
>> "pushing" data from the server to the client through the same tunnel.
[quoted text clipped - 5 lines]
> possibility I can think of is to send responses with the 100 status
> code. As far as I know, in that case it's possible to send more responses.
No, that is not what I mean. I'm talking about a client sending a
request and simultaneously receiving data that is being "pushed" from
the server. The key here is that the data is being pushed or streamed
from the server. It is a "push" model i.e. not the typical "pull" model.
Again, of the top of my head - I think I could have the datastream
listener running in another thread and then handling the streaming data
as it arrives (maybe it is tagged differently?). Which also suggests the
possible use of a buffer so that data dosen't get lost if the client is
busy.....
Andrea Desole - 20 May 2005 14:40 GMT
> Yeah. Sorry, I should have mentioned that I did not want to use SOAP
> because of all the "weight" of the XML payload and also the extra XML
> procesing required on both ends. I want this to be as lightweight as I
> can get away with (securely).
well, than you will have to do something similar; a servlet that gets
HTTP requests that contain, in the body, the paramters.
> My bad. I should have read what I was typing before I sent the post ;-).
> You are entirely right - the problem is to make the calls asynch. I have
> ideas about how to do it - an obvious one would be spawning a new thread
> which actually executes the HTTPRequest command, returning to the user
> and then calling back the callee when the data arrives/times out etc,
> but I wanted to know if there is another (more elegant?) way.
don't think so. This is the regular solution.
> No, that is not what I mean. I'm talking about a client sending a
> request and simultaneously receiving data that is being "pushed" from
> the server. The key here is that the data is being pushed or streamed
> from the server. It is a "push" model i.e. not the typical "pull" model.
I think I understood correctly. The problem is that you don't have push
in HTTP. What I can imagine is that the client sends a first request to
the server, and then the server sends multiple responses. This might
simulate a push model.
> Again, of the top of my head - I think I could have the datastream
> listener running in another thread and then handling the streaming data
> as it arrives (maybe it is tagged differently?). Which also suggests the
> possible use of a buffer so that data dosen't get lost if the client is
> busy.....
I'm not sure, but if you want to use streaming you should check how it
works with a proxy.