Socket.io

2,282
-1

Published on

socket, socket.io, node.js, nodejs, js

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,282
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
30
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Socket.io

  1. 1. @diego_pachecoSoftware Architect | Agile Coach
  2. 2. HotSpot(20x faster)Lars Bak JIT Threads Assembler
  3. 3. non-blocking i/o VS blocking i/o
  4. 4. Http,Tcp,File BindingsEvented I/OGood Speed(Performance)Good for concurrencyEverything AsynchronousJS Server SideRuns on Google V8Supports for Redis & MongoDBReal time apps with WebSockets(html 5)Rubys Event Machine or Pythons Twisted
  5. 5. Why Socket.io? Why Not WebSockets?
  6. 6. Features Transparent Transport API Authorization Timeouts Heartbeats / Disconnection Cross Browser + Mobile/Tablets Reconnection + Buffering Multiple Sockets with same connection Modules (session, logger, node2node, mq)
  7. 7. Multi-Transport Socket for
  8. 8. Select the best transport option: WebSocket Adobe® Flash® Socket AJAX long polling AJAX multipart streaming Forever Iframe JSONP Polling
  9. 9. [server.js]
  10. 10. [index.html]
  11. 11. $ node server.js info - socket.io started debug - client authorized info - handshake authorized 10976962382111866647 debug - setting request GET /socket.io/1/websocket/10976962382111866647 debug - set heartbeat interval for client 10976962382111866647 debug - client authorized for debug - websocket writing 1:: debug - websocket writing 5:::{"name":"news","args":[{"hello":"world"}]}{ my: data }
  12. 12. [calc.html]
  13. 13. $ node calc.js info - socket.io started debug - client authorized info - handshake authorized 19733746072008321086 debug - setting request GET /socket.io/1/websocket/19733746072008321086 debug - set heartbeat interval for client 19733746072008321086 debug - client authorized for debug - websocket writing 1::doop event received.{ va: 10, vb: 21, op: + } debug - websocket writing 5:::{"name":"result","args":[{"result":31}]}
  14. 14. Thank You!@diego_pachecoSoftware Architect | Agile Coach

×