1 what can html5 websocket do for you? sidda eraiah director of management services kaazing...
TRANSCRIPT
![Page 1: 1 What Can HTML5 WebSocket Do For You? Sidda Eraiah Director of Management Services Kaazing Corporation](https://reader030.vdocuments.mx/reader030/viewer/2022032707/56649e305503460f94b20d8a/html5/thumbnails/1.jpg)
1
What Can HTML5 WebSocket Do For You?
Sidda EraiahDirector of Management ServicesKaazing Corporation
![Page 2: 1 What Can HTML5 WebSocket Do For You? Sidda Eraiah Director of Management Services Kaazing Corporation](https://reader030.vdocuments.mx/reader030/viewer/2022032707/56649e305503460f94b20d8a/html5/thumbnails/2.jpg)
2
What is HTML5 WebSocket?
Copyright © 2010, Kaazing Corporation,. All rights reserved.
• A full-duplex bidirectional communication channel in javascript
- over the internet
- over existing infrastructure
- yes, very much like a TCP connection
• JavaScript API in all HTML5 complaint browsers
![Page 3: 1 What Can HTML5 WebSocket Do For You? Sidda Eraiah Director of Management Services Kaazing Corporation](https://reader030.vdocuments.mx/reader030/viewer/2022032707/56649e305503460f94b20d8a/html5/thumbnails/3.jpg)
3
HTML5 WebSocket API
Copyright © 2010, Kaazing Corporation,. All rights reserved.
interface WebSocket { readonly attribute DOMString url;
// ready state CONNECTING=0, OPEN=1; CLOSING=2; CLOSED=3; readonly attribute unsigned short readyState;
readonly attribute unsigned long bufferedAmount;
// networking attribute Function onopen; attribute Function onmessage; attribute Function onerror; attribute Function onclose;
boolean send(in DOMString data); void close();
};
WebSocket implements EventTarget;
![Page 4: 1 What Can HTML5 WebSocket Do For You? Sidda Eraiah Director of Management Services Kaazing Corporation](https://reader030.vdocuments.mx/reader030/viewer/2022032707/56649e305503460f94b20d8a/html5/thumbnails/4.jpg)
4
HTML5 WebSocket example
Copyright © 2010, Kaazing Corporation,. All rights reserved.
var ws = new WebSocket(“ws://game.example.com:12010/updates”);
ws.onopen = function () {alert(“Connection open ...”);
}
ws.onclose = function () {alert(“Connection closed.”);
}
ws.onmessage = function () {alert( “Received Message: ” + evt.data);
}
![Page 5: 1 What Can HTML5 WebSocket Do For You? Sidda Eraiah Director of Management Services Kaazing Corporation](https://reader030.vdocuments.mx/reader030/viewer/2022032707/56649e305503460f94b20d8a/html5/thumbnails/5.jpg)
5
What about Comet?
Copyright © 2010, Kaazing Corporation,. All rights reserved.
• As mini-documents served by • Comet • Reverse Ajax • Ajax Push
• Based on HTTP 1.1 protocol• half-duplex
• Each request has HTTP header traffic• Does not scale
![Page 6: 1 What Can HTML5 WebSocket Do For You? Sidda Eraiah Director of Management Services Kaazing Corporation](https://reader030.vdocuments.mx/reader030/viewer/2022032707/56649e305503460f94b20d8a/html5/thumbnails/6.jpg)
6
Why do you need it?
Copyright © 2010, Kaazing Corporation,. All rights reserved.
• Ultra low latency data in your web client • with very little overhead• scalable applications• low cost
• Adiós Comet, Hola WebSocket!!!
![Page 7: 1 What Can HTML5 WebSocket Do For You? Sidda Eraiah Director of Management Services Kaazing Corporation](https://reader030.vdocuments.mx/reader030/viewer/2022032707/56649e305503460f94b20d8a/html5/thumbnails/7.jpg)
7
Less Network Traffic• 2 bytes overhead per WebSocket Frame• One TCP connection instead of
establishing new TCP connection for each HTTP message (or mini-document)
Copyright © 2010, Kaazing Corporation,. All rights reserved.
![Page 8: 1 What Can HTML5 WebSocket Do For You? Sidda Eraiah Director of Management Services Kaazing Corporation](https://reader030.vdocuments.mx/reader030/viewer/2022032707/56649e305503460f94b20d8a/html5/thumbnails/8.jpg)
8
See the difference in action
Copyright © 2010, Kaazing Corporation,. All rights reserved.
Ericsson Labs Video
![Page 9: 1 What Can HTML5 WebSocket Do For You? Sidda Eraiah Director of Management Services Kaazing Corporation](https://reader030.vdocuments.mx/reader030/viewer/2022032707/56649e305503460f94b20d8a/html5/thumbnails/9.jpg)
9
Polling vs. WebSocket
Copyright © 2010, Kaazing Corporation,. All rights reserved.
![Page 10: 1 What Can HTML5 WebSocket Do For You? Sidda Eraiah Director of Management Services Kaazing Corporation](https://reader030.vdocuments.mx/reader030/viewer/2022032707/56649e305503460f94b20d8a/html5/thumbnails/10.jpg)
10
Overheard… “Reducing kilobytes of data to 2 bytes…and
reducing latency from 150ms to 50ms is far more than marginal. In fact, these two factors alone are enough to make WebSocket seriously interesting to Google.”—Ian Hickson (Google, HTML5 spec lead)
Copyright © 2010, Kaazing Corporation,. All rights reserved.
![Page 11: 1 What Can HTML5 WebSocket Do For You? Sidda Eraiah Director of Management Services Kaazing Corporation](https://reader030.vdocuments.mx/reader030/viewer/2022032707/56649e305503460f94b20d8a/html5/thumbnails/11.jpg)
11
Apps with HTML5 WebSocket• Quake with HTML5 canvas and WebSockets
• http://www.kaazing.me
• Trading applications
Copyright © 2010, Kaazing Corporation,. All rights reserved.
![Page 12: 1 What Can HTML5 WebSocket Do For You? Sidda Eraiah Director of Management Services Kaazing Corporation](https://reader030.vdocuments.mx/reader030/viewer/2022032707/56649e305503460f94b20d8a/html5/thumbnails/12.jpg)
12
What else can you build?• Protocols based on HTML5 WebSocket
• XMPP and its extensions• AMQP• IRC• STOMP• Custom protocols
Copyright © 2010, Kaazing Corporation,. All rights reserved.
![Page 13: 1 What Can HTML5 WebSocket Do For You? Sidda Eraiah Director of Management Services Kaazing Corporation](https://reader030.vdocuments.mx/reader030/viewer/2022032707/56649e305503460f94b20d8a/html5/thumbnails/13.jpg)
13
HTML5 WebSocket Browsers• Google Chrome• Safari (dev)• Opera (dev)• Coming soon to Firefox – Bug 472529
Copyright © 2010, Kaazing Corporation,. All rights reserved.
![Page 14: 1 What Can HTML5 WebSocket Do For You? Sidda Eraiah Director of Management Services Kaazing Corporation](https://reader030.vdocuments.mx/reader030/viewer/2022032707/56649e305503460f94b20d8a/html5/thumbnails/14.jpg)
14
HTML5 WebSocket Summary
Copyright © 2010, Kaazing Corporation,. All rights reserved.
• Disruptive technology• A full-duplex bidirectional communication
channel from your browser to a server
- over the internet
- over existing infrastructure
- ultra low latency
- scalable
- extendable
- reduces your infrastructure costs
![Page 15: 1 What Can HTML5 WebSocket Do For You? Sidda Eraiah Director of Management Services Kaazing Corporation](https://reader030.vdocuments.mx/reader030/viewer/2022032707/56649e305503460f94b20d8a/html5/thumbnails/15.jpg)
15
Kaazing WebSocket Server• Check out kaazing.com and kaazing.me• Provides HTML5 WebSocket API for Non-
HTML5 browsers• IE 6 & up• Firefox 2 & up • others
• Provides HTML5 WebSocket API to• Flex / Actionscript• .NET & Silverlight• Java FX & Java Web Start
• We are hiring
Copyright © 2010, Kaazing Corporation,. All rights reserved.
![Page 16: 1 What Can HTML5 WebSocket Do For You? Sidda Eraiah Director of Management Services Kaazing Corporation](https://reader030.vdocuments.mx/reader030/viewer/2022032707/56649e305503460f94b20d8a/html5/thumbnails/16.jpg)
16
HTML5 Book
Copyright © 2010, Kaazing Corporation,. All rights reserved.
Available now
![Page 17: 1 What Can HTML5 WebSocket Do For You? Sidda Eraiah Director of Management Services Kaazing Corporation](https://reader030.vdocuments.mx/reader030/viewer/2022032707/56649e305503460f94b20d8a/html5/thumbnails/17.jpg)
17
HTML5 training
10% Off Any HTML5 Training
With Coupon Code WEB2EXPO
http://tech.kaazing.com/training/index.html
Copyright © 2010, Kaazing Corporation,. All rights reserved.
![Page 18: 1 What Can HTML5 WebSocket Do For You? Sidda Eraiah Director of Management Services Kaazing Corporation](https://reader030.vdocuments.mx/reader030/viewer/2022032707/56649e305503460f94b20d8a/html5/thumbnails/18.jpg)
18
Copyright © 2010, Kaazing Corporation,. All rights reserved.
Q&A
![Page 19: 1 What Can HTML5 WebSocket Do For You? Sidda Eraiah Director of Management Services Kaazing Corporation](https://reader030.vdocuments.mx/reader030/viewer/2022032707/56649e305503460f94b20d8a/html5/thumbnails/19.jpg)
19
Polling, Long-Polling, Streaming
Copyright © 2010, Kaazing Corporation,. All rights reserved.
Polling Long-Polling
Streaming
• Polling is resource intensive
• Long-Polling degrades to polling during high message frequency
• Streaming has issues through firewalls and proxies
![Page 20: 1 What Can HTML5 WebSocket Do For You? Sidda Eraiah Director of Management Services Kaazing Corporation](https://reader030.vdocuments.mx/reader030/viewer/2022032707/56649e305503460f94b20d8a/html5/thumbnails/20.jpg)
20