Upload
codecampiasi
View
756
Download
0
Tags:
Embed Size (px)
Citation preview
Friday, March 9, 12
WebSockets with AtmosphereDan Vulpe@dvulpe
10 mar 2012
Friday, March 9, 12
HTTP - Half Duplex
Client Server
Request
Friday, March 9, 12
HTTP - Half Duplex
Client Server
Request
Response
Request
ResponseConnection 2
30-150ms
Friday, March 9, 12
HTTP - Half Duplex
Client Server
Request
Response
Request
ResponseConnection 2
30-150ms
HttpSession
Friday, March 9, 12
WebSocket Full Duplex
Client Server
Single TCP connection
Friday, March 9, 12
WebSocket Full Duplex
Client Server
Handshake Request
WebSocket upgrade
Single TCP connection
Friday, March 9, 12
Atmosphere
• Java Framework provides uniform Comet API
• Supports: WebLogic, Tomcat, Jetty, Glassfish, JBoss, Grizzly, Servlet 3.0 Async
• Fallback to blocking-IO (one thread per channel)
• jQuery plugin
• WebSocket façade
Friday, March 9, 12
Components
Http RequestMeteorServlet
AtmosphereResource Broadcaster
Friday, March 9, 12
Server: Incoming
• Implement SubProtocol
• handle onMessage events
Friday, March 9, 12
Server: Outgoing
• Request a Broadcaster from Factory
• Subscribe resources to Broadcaster
• Publish messages through Broadcaster
Friday, March 9, 12
JS Client API
Friday, March 9, 12
DEMO
Friday, March 9, 12
Java Support
• Server side
• JSR356 - Java API for WebSocket - In Progress
• Containers: Jetty(7, 8), Grizzly/Glassfish, Resin
• Client
• async-http-client
Friday, March 9, 12
Resources
• https://github.com/Atmosphere/atmosphere
• http://www.websocket.org/
• http://www.w3.org/TR/websockets/
• http://wiki.eclipse.org/Jetty/Feature/WebSockets
Friday, March 9, 12
Thank you!Please fill out the evaluation form!
Friday, March 9, 12