0

is it any simpler way then cometd as long-polling framework for java? Because what I need - is client specifies some parameters and sends them to server. Server process them and starts contonuously pushing messages back to client (looks like Thread-per-Service?). Client receivs messages and displays them. Client has possibility to stop listening and actually stop server's service to send messages. Maybe I'm too lazy, but cometd's examle was not that short and transparent as I wanted it to be.

Not HTML5 based.

user715022
  • 85
  • 4
  • 16
  • Maybe www.icepush.org is what you are looking for? – Simon C Oct 08 '11 at 18:55
  • WebSockets with fallback to a Flash socket connection covers a **very large** percentage of all browsers (assuming the clients connecting to your server are Web Browsers). I'd strongly recommend you read [this SO answer on WebSocket readiness](http://stackoverflow.com/questions/6434088/why-isnt-bosh-more-popular-especially-as-an-alternative-to-websockets-and-long#6442488). If you don't want to install and host your own realtime solution (Comet or WebSockets) then you might want to consider a [hosted solution](http://www.leggetter.co.uk/real-time-technologies-guide#hosted-services). – leggetter Oct 09 '11 at 20:46

3 Answers3

4

With SSE ( server sent events ) you can do exactly what you explained you want to do, but unfortunately it's HTML5 technology .
If your interested you can check html5rocks for further information.

Rsh
  • 7,214
  • 5
  • 36
  • 45
  • thank you for your reply, I'll _definitly_ do this, when IE will have normal support for HTML5, and HTML5 will be standard. – user715022 Oct 08 '11 at 18:46
0

These guys Atmosphere Asynchronous WebSocket/Comet Framework really made nice job at simplifying the server push process with fallbacks mechanism when browser and/or server parts does not support websockets

A. Masson
  • 2,287
  • 3
  • 30
  • 36
0

Well if you are too lazy for cometd or reverse AJAX you can deploy a web service endpoint to your client (preferably restful and not SOAP) and have your server send back messages to your web service (acting as a client).

It is simple to implement this.

In your clien't initial request to the server, along with the other parameter, you can also send the port (or URL) that your endpoint is listening for notification.

Then you just have to define the notification events and implement the rest of the logic.

Cratylus
  • 52,998
  • 69
  • 209
  • 339
  • Thank you for response. I'm not familar with REST - but I see, that I need to :) So, if I'll f**k up with cometd - then, probably, will start with REST. Is it some specific framework, that provides mentioned functionality? – user715022 Oct 08 '11 at 18:39
  • For now cometd looks a bit difficult, but powerfull. So I'm continue digging. If It will be success - I'll put my result here. – user715022 Oct 08 '11 at 18:57
  • Ok.Don't do REST.Open a server socket in your client and get messages – Cratylus Oct 08 '11 at 19:36