Socket.IO
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Socket.IO

on

  • 15,836 views

Presentation from nodecamp.eu

Presentation from nodecamp.eu

Statistics

Views

Total Views
15,836
Views on SlideShare
15,813
Embed Views
23

Actions

Likes
13
Downloads
197
Comments
1

4 Embeds 23

http://paper.li 13
http://aws.w3db.us 5
http://www.linkedin.com 4
https://si0.twimg.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • socket.io v0.7 is great. Thanks a lot.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Socket.IO Presentation Transcript

  • 1. GETTING DIRTY WITH 0.7SOCKET.IO
  • 2. HELLO > WHOAMI
  • 3. { "name": "socket.io" , "version": "0.7.0" , "description": "Real time apps made cross-browser & easy with a WebSocket-like API" , "keywords": ["websocket", "realtime", "socket.io", "comet", "ajax"] , "author": "Guillermo Rauch <guillermo@learnboost.com>" , "contributors": [ { "name": "Guillermo Rauch", "email": "rauchg@gmail.com" } , { "name": "Arnout Kazemier", "email": "info@3rd-eden.com" } ] , "repository":{ "type": "git" , "url": "https://github.com/LearnBoost/Socket.IO-node.git" } , "dependencies": {} , "main": "index" , "engines": { "node": ">= 0.4.0" }}
  • 4. STALK ME ON TWITTER@3rdEden FORK ME ON GITHUB@3rd-Eden
  • 5. WHAT IS SOCKET.IO
  • 6. open source
  • 7. REAL TIME
  • 8. DIRTY
  • 9. FAST
  • 10. F*CKING AWESOME
  • 11. CROSS BROWSER
  • 12. CROSS BROWSERINCLUDING MOBILE & INTERNET EXPLORER 5
  • 13. CROSS BROWSER ORLY? YA RLY
  • 14. web socket
  • 15. web socketflash socket
  • 16. web socketflash sockethtml file (forever iframe)
  • 17. web socketflash sockethtml file (forever iframe)xhr multipart
  • 18. web socketflash sockethtml file (forever iframe)xhr multipartxhr polling
  • 19. web socketflash sockethtml file (forever iframe)xhr multipartxhr pollingjsonp polling
  • 20. community WATCHERS 2750+ FORKS 250+ PULL REQUESTS 110+GROUPS MEMBERS 1000~
  • 21. NODE CAMP USERSY U NO FORK
  • 22. WHATʼS NEW IN 0.7THE LESSONS WE LEARNED FROM 0.6
  • 23. COMPLETE API REWRITE
  • 24. var io = require(ʻsocket.ioʼ) , http = require(ʻhttpʼ);var s = http.createServer(function(q,r){r.writeHead(200);r.end(ʻsupʼ)});s.listen(80)io.listen(s); // uses existing server
  • 25. var io = require(ʻsocket.ioʼ) , http = require(ʻhttpʼ);var s = http.createServer(function(q,r){r.writeHead(200);r.end(ʻsupʼ)});s.listen(80)io.listen(s); // uses existing servervar io = require(ʻsocket.ioʼ);io.listen(80); // creates one for us
  • 26. var io = require(ʻsocket.ioʼ).listen();// express styled configurationio.configure(ʻdevelopmentʼ, function(){ io.set(ʻlog levelʼ, 3);});
  • 27. MULTIPLEPROCESSES
  • 28. NEW PROTOCOL
  • 29. MESSAGE FLAGS FIRE AND FORGET, JSON NEW PROTOCOL
  • 30. io.sockets.on(ʻconnectionʼ, function (socket) { socket.volatile.send(ʻpew pewʼ); socket.json.send([{nodecamp:ʻftwʼ}]);}; NEW PROTOCOL
  • 31. ACKNOWLEDGEMENTS BETWEEN CLIENT & SERVER, SERVER & CLIENT NEW PROTOCOL
  • 32. // server sideio.sockets.on(ʻconnectionʼ, function (socket) { socket.send(ʻbyeʼ, function () { // ack });});// client sidevar socket = io.connect();socket.send(ʻhiʼ, function () { // ack}); NEW PROTOCOL
  • 33. NAMESPACING MULTIPLEXING NEW PROTOCOL
  • 34. // server sideio.sockets.on(ʻconnectionʼ, function (socket) { socket.send(ʻbyeʼ, function () { // ack });});// client sidevar socket = io.connect();socket.send(ʻhiʼ, function () { // ack}); NEW PROTOCOL
  • 35. HANDSHAKINGFUCK YEAH, SESSIONS SUPPORT NEW PROTOCOL
  • 36. EVENTS NEW PROTOCOL
  • 37. CODE SHARINGMODULES ARE REUSED ON THE CLIENT & SERVER
  • 38. TESTINGBOTH FOR THE CLIENT AND THE SERVER
  • 39. “ONE MORE THING™” © STEVE JOBS
  • 40. RELEASE THIS WEEK
  • 41. Q ATALK NERDY TO ME
  • 42. presentation.end(‘thanks’);