Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

comet HTTP patterns in Java

I'm writing/porting a C++ HTTP event server to Java. I'm wondering what are the best paradigms for implementing comet with Jetty, Tomcat, any other server, or natively.

  • Threaded
  • Continuations
  • NIO
  • Servlet 3.0

Scalability is an absolute must as I'm developing a new protocol that uses up to 3 concurrent connections per client.

Any help is appreciated.

PS: If possible, I would love to also see some sample code or tutorials..

like image 492
David Titarenco Avatar asked Feb 06 '10 05:02

David Titarenco


People also ask

What is the benefit of enabling and using Comet?

Comet is a programming technique that allows a web server to send updates to clients without requiring the clients to explicitly request them. This kind of programming technique is called server push, which means that the server pushes data to the client.

What is Comet in real time reaction?

Comet is a web application design paradigm that describes a continuous, two-way interaction between a server and a web browser using native HTTP methods.

What is Comet Javascript?

Comet is a web application model in which a long-held HTTPS request allows a web server to push data to a browser, without the browser explicitly requesting it. Comet is an umbrella term, encompassing multiple techniques for achieving this interaction.


1 Answers

We've had a lot of success with Caucho Resin's LongPoll features (the majority of the data to our UI comes in over Comet). Caucho has also added support for WebSockets, so if you have an HTML 5 client you can benefit there too.

On Linux they have some custom JNI code that talks directly to epoll, which allows the server to scale well.

like image 125
Michael Barker Avatar answered Oct 28 '22 13:10

Michael Barker