Robert M. Gary wrote:
> I'm attempting to web enable one of my java applications (for a variety
> of reasons, including the https security).
>
> In one case, my client expect to connect to the server long term and
> just receive async information as it happens.
What happens?
> That doesn't seem to fit
> the http model. but I know its been done. Do you just do an HTTP_GET,
> then hang, then reissue a new HTTP_GET after each piece of data?
Now you are mixing the directions. Does the server send notifications,
or does the client send requests?
> DOesn't that cause a lot of disconnect/reconnects?
HTTP is probably not the best protocol for a notification service. It is
a request/response protocol. So let's assume you mean requests with long
periods of inactivity between them.
Protocol-wise you can keep the connection if you use an HTTP
implementation which can do persistent connections. Even in HTTP 1.1
persistent connections are optional, although they are highly
recommended, and typically they are implemented.
But that alone doesn't help. You need to keep the connection alive to
avoid timeouts.
However, if you requests are indeed sporadic, I don't see the need to
keep the connection alive. Why have a connection hanging around and
using some resources if you just once in a while use it?
I really can't remember which HTTP version the standard library does,
and if it does persistent connections. You have to investigate that for
a start.
/Thomas
--
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/...g/java/gui/faq
http://www.uni-giessen.de/faq/archiv....java.gui.faq/