10. Pull Based (Polling)
Periodic Polling (JS/AJAX)
Latest Score?
AUS 312/7
Latest Score?
Same
Latest Score?
Same
Server Client
Latest Score?
AUS 316/7
Latest Score?
Same
11. Push Based (Comet)
Server Push/Long Polling (JS/AJAX/iframe)
Latest Score?
AUS 312/7
Latest Score?
Server Client
AUS 316/7
Latest Score?
12. • Request / Response
• Too Many
• Server Connections
• Heavy Headers
• Outdated Content
13. Streaming Server Side Hack
Latest Score?
AUS 312/7 (1/n)
Server Client
AUS 316/7 (2/n)
IND 0/0 (n/n)
14. Latest Score?
(1/n)
AUS 312/7 (n-1 to go)
Server Server
Buffer Client
AUS 316/7
(2/n)
AUS 312/7
(n-2 to go)
AUS 316/7
IND 0/0 IND 0/0
(n/n)
PROXY
15. Others
• RTMP
• Adobe
• Are you Still using Flash?
• RTD
• Windows/Excel
• Non Web
17. The Web Socket Way The Original Route
Hey Server!
Hi Client!
Update me the Score
AUS 312/7
Server Client
AUS 316/7
IND 0/0
Not Interested. Bye
18. Hey Server!
Hi Client!
Update me the Score
AUS 312/7
Update Over info too
(93.0 ov)
Server (94.0 ov) Client
AUS 316/7
(95.0 ov)
IND 0/0
(0.0 ov)
Not Interested. Bye
41. Developer Friendly
1. var ws = new WebSocket("ws://sivaa.in/demo");
CONNECTING
2. ws.onopen = function() {
ws.send("Hello Server!");
OPEN
};
3. ws.onmessage = function(event) {
alert("Reply from Server " + event.data);
};
n-1. ws.send("This is the message sent by the client");
n. ws.close() CLOSING
CLOSED
42. The Guards
(Proxy / Firewall)
• Closing Long Lived Connections
• Unresponsive Server
• Buffering Server Response
• Non Encryption
• More Latency
43. Web Sockets and
The Guards
• Web Sockets doesn’t Proxy
• Stripping HTTP Headers
• Upgrade
• Options to disable
• Rejecting Server Response
• Frames (HTTP Headers Expected)
• wss:// - No issues
45. Java EE 7 & Web Socket
• JSR 356
• Java EE 7
• Tyrus ( http://tyrus.java.net/ )
• Web Socket SDK
• Reference Implementation
46. Server Side Capabilities
(Expected)
• Handshake Response to Clients
• Source/Origin Check
• URI Resolving & Matching
• Sub Protocols Negotiation
• Extension Negotiation
47. Handlers
• End point (to handle life cycle events)
• Session (Current Active Session)
• Remote End Point (Peer)
• Message Handler (incoming messages)
• Error Handler