Nodejs on 02/22/2012

1,155 views

Published on

Brief introduction of node.js and WebSocket

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

No Downloads
Views
Total views
1,155
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
0
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Nodejs on 02/22/2012

  1. 1. Hidetomo Morimoto http://github.com/mocchidesu 2012/02/22
  2. 2. <ul><li>What is Node.js </li></ul><ul><li>Intro to WebSocket </li></ul><ul><li>Demo (“hello world”, chat, file sharing) </li></ul><ul><li>Q&A </li></ul><ul><li>Reference </li></ul>
  3. 3. <ul><li>Server Side JavaScript / Single Thread Event Loop model (Apache vs. Nginx) </li></ul><ul><li>Introduced 01/2009 by Ryah Dahl </li></ul><ul><li>Current version: 0.6.11 </li></ul><ul><li>Written in C++ / v8 engine (JIT). </li></ul><ul><li>Non Blocking I/O (C10K issue) </li></ul>
  4. 4. <ul><li>http://www.aaronstannard.com/post/2011/12/14/Intro-to-NodeJS-for-NET-Developers.aspx </li></ul>
  5. 5. <ul><li>http://blog.hemca.com/?p=917 </li></ul>
  6. 6. <ul><li>Pros </li></ul><ul><li>High Performance </li></ul><ul><li>Cons </li></ul><ul><li>One single failure -> disaster </li></ul><ul><li>Multi-processor/multi-core not supported </li></ul>
  7. 7. <ul><li>TCP based connection. </li></ul><ul><li>Bi-directional, full-duplex </li></ul><ul><li>No polliing. It’s realtime. </li></ul><ul><li>Light weight. (No HTTP header. No repeated 3-way handshake) </li></ul>
  8. 8. <ul><li>BEFORE WEBSOCKET </li></ul><ul><li>WEBSOCKET NETWORK </li></ul><ul><li>http://www.atmarkit.co.jp/fdotnet/chushin/introhtml5_05/introhtml5_05_01.html </li></ul>
  9. 9. <ul><li>Embedded iFrame </li></ul><ul><li>AJAX/XHR (Internet Explorer 5.0) Mar. 1999 </li></ul><ul><li>Comet (Long Polling) </li></ul><ul><li>WebSocket <- Here !! </li></ul>
  10. 10. <ul><li>Hello World in Node.js </li></ul>var http = require('http'); var server = http.createServer( function (request, response) { response.writeHead(200, {'Content-Type': 'text/plain'}); response.write('Hello World!!n'); response.end(); } ).listen(8124, “127.0.0.1”);
  11. 11. <ul><li>Online Chat in 15 minutes. </li></ul>
  12. 12. <ul><li>Tensoid (Sendoid impl. w/o Flash) </li></ul><ul><li>http://tensoid.pictshare.me </li></ul>
  13. 13. <ul><li>HTML5 rocks </li></ul><ul><li>Event Driven vs. Multi Thread </li></ul><ul><li>Future? Buzz word? A lot of existing web applications have already adapted </li></ul><ul><li>Many things you can do it. </li></ul>
  14. 15. <ul><li>http://nodejs.org/ </li></ul><ul><li>http://tools.ietf.org/html/rfc6455 </li></ul><ul><li>http://socket.io </li></ul><ul><li>http://nodeknockout.com/ </li></ul><ul><li>http://github.com/atsuya/tensoid </li></ul><ul><li>http://github.com/mocchidesu/sample_chat </li></ul><ul><li>Thank you. </li></ul>

×