Re: HTTP tunneling and Servlet communication





Andrea Desole wrote:



exquisitus wrote:

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 therefore need http/s tunneling to communicate with clients). I have come up with a class which acts as a Facade to clients and presents a course simpler request/response API to clients. I have a Requset Factory which creates Asynch and Synch Requests. I am however stuck now and need some help. I am not sure how to convert my method call into an HTTP request (I have read several Servlet tutorials but still can't see a usefule xample that shows how a thick client can use a servlet - all examples seem to be about web browsers).


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 there are all pretty much hacks. i would be grateful for any ideas or pointers here.


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. Is this possible?. Can I send request/responses AND data on the same tunnel (presumably the same port)?.


I don't know if this is possible. The problem here is basically to get more http responses for one request, which is fairly hard. The only 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.....


.



Relevant Pages

  • RE: process starvation with 2.6 scheduler
    ... The network traffic is of request response type. ... The netperf clients run on an external box, ... A client sends request to a server, ... With an ICE connected to the Palladium (emulator) I have dumped the kernel data structures of the starved process and the active process. ...
    (Linux-Kernel)
  • Re: VB6 Winsock action on Server
    ... my usage of server app I meant the app on the server ... It is this piece 'dll' that i ... to delegate each request to a separate instance ... back to your Clients directly from *inside* the WorkerThreads, ...
    (microsoft.public.vb.general.discussion)
  • Re: Millions of Threads ?
    ... phones as clients. ... Of course, I need a server, too. ... turn-around time of 0.5 seconds, that suggests that you would have an average ... Notice that, on the above assumptions, you will be serving a request at ...
    (comp.lang.java.programmer)
  • Re: DHCP basic question - turning on scope of same range?
    ... The Clients always request the same number they ... I've juggled DHCP Servers around here a few times and I only ... It would> be a good idea after the change to have the clients release and renew their> addresses. ... I have configured a DHCP scope of the same IP>> range on a W2K server and would like to simply shut off ...
    (microsoft.public.win2000.networking)
  • RE: Users Cant Access Documents on Server
    ... Thanks for using the SBS newsgroup. ... As well as we know, if a workstation would not access network shares, then ... Leave the Default Gateway of the internal NIC blank of the server box. ... Clients That Require SMB Signing ...
    (microsoft.public.windows.server.sbs)

Loading