Download presentation
Presentation is loading. Please wait.
Published byBlaise Willis Modified over 9 years ago
1
WHIM Presentation Topic : Comet and Jetty 6 Yu Song ys2310@columbia.edu April 17 2007
2
Before Introduction Usual Client ~ Server interaction When an Internet Application needs to be updated, the only possible choice is to use polling. Clients send requests over HTTP protocol and Server sends back data and then close the session.
3
Before Introduction contd. The HTTP protocol makes it impossible to have the server "push" data to the client. The faster the client needs to be updated, the faster the poll must be. Of course, there are limits, for example due to the network speed, the load, etc. Web chat application was impractical due to it’s huge amount of pollings.
4
Introduction What's COMET? Like Ajax, COMET, rather than a new program or a protocol, is a concept or implementation of a way to manage the HTTP connection.COMET
5
So, what’s new? Clients send HTTP requests. Server side doesn’t send back responses right away. Server side keeps these connections. When the server was “kicked”, it sends data back to all clients using the those connections.
6
Comet vs. Ajax Ajax is a technology which separates browser display and browser~server interaction. (ex. Google Map) Comet is a technology separates clients polling and browser~server interaction. (ex. Gmail, GTalk, and Renkoo)
7
Comet vs. Ajax contd. implementation Figure from http://dylan.io/
8
Comet vs. Ajax contd. “Comet application fight lag by avoiding HTTP and TCP/IP set-up and tear-down and a single connection is re-used. But the big kicker for AJAX is polling latency which Comet avoids. The big takeaway: transfer only the necessary data, exactly when it’s most relevant.” [cited] Comet: Beyond Ajax – by Dr. Phil Windley 2006 http://www.irishdev.com/NewsArticle.aspx?id=2173
9
Example Demo Lingr … Web-browser Chat System http://www.lingr.com/ You can paste not just smiley but also real pictures and even YouTube videos. http://www.columbia.edu/images/slidesho w/cu_home_aerial_winter.jpghttp://www.columbia.edu/images/slidesho w/cu_home_aerial_winter.jpg http://www.youtube.com/watch?v=6HPgxK S5c4Uhttp://www.youtube.com/watch?v=6HPgxK S5c4U
10
Demo Screenshot
11
Lingr Web server (kicks Chat server) Chat server Jetty 6 (thread solution) JSONP (cross-domain Problem solution)
12
Lingr Contd. Merits Lightness … don’t need install Chat room … real-time social network Anonymous access … don’t need log-in Image, Viedo support … jpg, YouTube Chat log … can be used as database Hot tag … can search chat room by tag API … create your own Web-chat app
13
Issues with Comet Appache server allocates one thread to each HTTP connection Server has to keep all these threads till it returns response. Consuming server resources when idle. May crash server when there are lots of clients even no HTTP interactions.
14
Solution Use Jetty 6 server. This new-mainstream-server supports Continuations functionality. It manage thread separately from HTTP connection.
15
Conclusion Ajax will be used with Comet. Comet will be used with Jetty 6 Jetty 6 will be used with JSONP From now on more and more web applications will take advantage of these combinations of new technologies.
16
Thank you !
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.