Thank you both for the informative replies :)
However, I believe we can technically implement it now, using Comet
and "long polling".
What I'd like to do is:

1) The server is Tomcat, in my control. So I tell it not to close the
connection, just keep writing into it (using some separator to
indicate when one message starts and another begins)

2) On the browser side, use Ajax but wait for readyState=3 (rather
than 4), so as to keep reading data as it comes. Then it's just some
logical work to accumulate the data and parse it based on the
separator.

Of course that's still naiive and basic, but I thought it was worth a
try - just wondered whether Prototype can help me with this (receiving
data on readyState=3, and/or parsing it)?

Thanks again.


On Jan 3, 5:22 pm, sol <[email protected]> wrote:
> Hi,
>
> We are using Prototype Ajax on the client side, consuming messages
> from a Comet server.
> We were wondering whether it's possible to keep a connection alive,
> and pass multiple messages on the same connection (for "Server push")?
>
> It's something in the lines of:
> - Client opens an Ajax.request
> - The server sends a reply message; the client consumes it (onsuccess)
> - Now usually, the HTTP connection would be closed; if the client
> expects more messages, it should open a new request and a new
> connection.
> - But we'd like to keep the connection alive for a while (on both
> client and server), so that if the server discovers new data (say 5
> minutes later) it can push a new message on the same connection, and
> hopefully trigger another callback on the client ('onsuccess').
>
> Of course this requires a way of telling when 1 message ends, and
> another begins... we were hoping this can be done based on some
> separator (perhaps multipart format?), or content-length.
>
> Is this supported on Prototype Ajax?
> Thanks :)

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to