Your SlideShare is downloading. ×
  • Like
WebSockets On Fire
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

WebSockets On Fire

  • 3,693 views
Published

HTML5 WebCamps talk on WebSockets

HTML5 WebCamps talk on WebSockets

Published in Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
3,693
On SlideShare
0
From Embeds
0
Number of Embeds
3

Actions

Shares
Downloads
61
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. WebSockets On Fire
    HTML5 WebCamps 2011
  • 2. Whois
    Jef Claes
    Ferranti Computer Systems
    @JefClaes
    http://jclaes.blogspot.com
    Jef.claes@gmail.com
  • 3. Content
    WHY do we need WebSockets?
    WHATare WebSockets?
    What is the state ofWebSockets TODAY?
    So show me some CODE.
  • 4. Content
    WHY do we need WebSockets?
    WHATare WebSockets?
    What is the state ofWebSockets TODAY?
    So show me some CODE.
  • 5. DIRECT COMMUNICATION between browser and server
  • 6. Chat applications
  • 7. Collaborative tools
  • 8. Socialnetworking
  • 9. Online gaming
  • 10. But haven’t we been doingthisfor a while?
  • 11. COMET
  • 12. 1. Frequent polling
  • 13. Browser
    Server
    HTTP Request
    HTTP Response
  • 14. GET /PollingStock//PollingStock HTTP/1.1Host: localhost:8080User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8Accept-Language: en-usAccept-Encoding: gzip,deflateAccept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7Keep-Alive: 300Connection: keep-aliveReferer: http://www.example.com/PollingStock/Cookie: showInheritedConstant=false; showInheritedProtectedConstant=false; showInheritedProperty=false; showInheritedProtectedProperty=false; showInheritedMethod=false; showInheritedProtectedMethod=false; showInheritedEvent=false; showInheritedStyle=false; showInheritedEffect=falseHTTP/1.x 200 OKX-Powered-By: Servlet/2.5Server: Sun Java System Application Server 9.1_02Content-Type: text/html;charset=UTF-8
  • 15. Request / Response headers = 871 bytes
    1000 clients poll every 10 seconds
    1000 * 871 bytes = 0,8MB / 10 seconds
    0,8 MB * 6 = 4,8 MB / minute
    4,8 MB * 60 = 288 MB / hour
    288 MB * 24 = 6,912 GB / day
  • 16. 2. Long polling
  • 17. Waitfor it...
    Browser
    Server
    HTTP Request
    HTTP Response
  • 18. Say NO to COMET
  • 19. Content
    WHY do we need WebSockets?
    WHATare WebSockets?
    What is the state ofWebSockets TODAY?
    So show me some CODE.
  • 20. ‘TCP for the Web’Full-duplex direct communication
  • 21. Browser
    Server
    HTTP
    HTTP
    WebSocket
    WebSocket
  • 22. WebSockets Handshake
    GET /demo
    HTTP/1.1 Upgrade: WebSocket
    Connection: Upgrade
    Host: example.com
    Origin: http://example.com
    Sec-WebSocket-Key1: 4 @1 46546xW%0l 1 5
    Sec-WebSocket-Key2: 12998 5 Y3 1
    .P00 ^n:ds[4U
    HTTP/1.1 101
    WebSocket Protocol Handshake
    Upgrade: WebSocket
    Connection: Upgrade
    Sec-WebSocket-Origin: http://example.com
    Sec-WebSocket-Location: ws://example.com/demo
    Sec-WebSocket-Protocol: sample
    8jKS'y:G*Co,Wxa-
  • 23. WebSockets message
    0x00 wsMessage0xFF
  • 24. Benefits
    Native implemented
    Lessthroughput
    Performance
    Complexity
  • 25. Content
    WHY do we need WebSockets?
    WHATare WebSockets?
    What is the state ofWebSockets TODAY?
    So show me some CODE.
  • 26. 1. HTML5
    Work In Progress
  • 27. 2. Browser support
    IE9: No
    Safari 5, Chrome 10:Yes
    FireFox 4, Opera 11: Yes, but…
    Mobile: No, only Safari :-(
    Source: http://caniuse.com
  • 28. 2. Browser support
    ALTERNATIVES yesssss
  • 3. The server
    HTML5 Labs (WCF)
    http://html5labs.interoperabilitybridges.com
    pywebsocket(Apache extension) http://code.google.com/p/pywebsocket/
    jWebSocket (Java)
    http://jwebsocket.org/
    web-socket-ruby (Ruby)
    https://github.com/gimite/web-socket-ruby

  • 30. Content
    WHY do we need WebSockets?
    WHATare WebSockets?
    What is the state ofWebSockets TODAY?
    So show me some CODE.
  • 31. Why?
    Information ASAP
  • 32. Information screens
    Paging
    JIT Printing
    Websites
    Why?
  • 33. 1. NetViewer
  • 34. 2. Current Incidents
  • 35. Silverlightclient
    WCF WebSockets Server
    Dispatcher
    Silverlightclient
    Silverlightclient
    http://html5labs.interoperabilitybridges.com/
  • 36. Code
  • 37. Conclusion
    WebSockets > COMET
    Notquite ready
  • 38. Recommended resources
    http://dev.w3.org/html5/websockets/
    http://html5labs.interoperabilitybridges.com
    http://blogs.msdn.com/b/interoperability/archive/tags/html5/
    http://jclaes.blogspot.com
  • 39. Q & A
  • 40. Joinus
    Twitter:
    @MSDNBelux
    Our tag today: #webcampbe
    Facebook:
    MSDN België (NL)
    MSDN BeLux (FR)
    Latestnews on www.msdn.be
    Always up to date: register to MSDN Flash and Express Yourselfhttp://www.msdn-newsletters.be
  • 41. Thankyou