Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Node.js道場:第1回Node.js入門勉強会課題レポート解答のヒント
Search
Shigeki Ohtsu
December 04, 2012
470
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Node.js道場:第1回Node.js入門勉強会課題レポート解答のヒント
Shigeki Ohtsu
December 04, 2012
More Decks by Shigeki Ohtsu
See All by Shigeki Ohtsu
Privacy Sandboxとはなにか/Privacy Sandbox Explained
shigeki
5
1.9k
内定者向け黒帯トーク#4/Kuroobi-Talk for fresh persons #4
shigeki
3
2.1k
Signed HTTP Exchanges (SXG)とはなにか/SXG Explained
shigeki
10
3.6k
Webプロトコル最前線
shigeki
0
530
運用の観点から見たTLSプロトコルの動き
shigeki
0
1.6k
祝Node-v10リリース これまでのNodeの振り返り
shigeki
7
3.7k
運用の観点から見たTLSプロトコルの動き
shigeki
14
3.9k
IETF QUICに至るプロトコルの透過性問題とその対策
shigeki
3
1.2k
QUIC WG報告
shigeki
4
1.3k
Featured
See All Featured
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
600
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
203
76k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
520
Building Applications with DynamoDB
mza
96
7.2k
Product Roadmaps are Hard
iamctodd
55
13k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
2.9k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
290
Building a Scalable Design System with Sketch
lauravandoore
464
34k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.9k
Faster Mobile Websites
deanohume
310
32k
Between Models and Reality
mayunak
4
460
Transcript
第1回Node.js勉強会 課題レ ポート解答のヒント IIJ 大津繁樹 2012 12/04
• 課題 – https://gist.github.com/4128771 • 解答一覧 – https://gist.github.com/11ae3360aab85b82a2ae
イベントのまとめ http.Server listening TCPポートをリスンした時 connection socket クライアントとTCPハンドシェイクが完了した時 request req,res HTTPリクエストのヘッダ部分の解析が完了した時
close 全クライアント接続が終了してサーバが終了する時 http.ServerRequest data chunk HTTPリクエストのボディデータを受信した時 end HTTPリクエストのボディデータを受信が完了した時 close res.endやフラッシュが完了する前のソケット切断時 http.ServerResponse close(*0.9.x) res.endやフラッシュが完了する前のソケット切断時 finish(*非公 開) 送信socketにデータの書き込みが完了した時
ソケット接続切断のまとめ • socket.end() – ハーフクローズ。FINを送るだけ。書き込み不可・ 読み込み可 • socket.destroySoon() – カーネルへの書き込みバッファが無くなったら
destory() する • socket.destroy() – 強制終了 (参考) Connction:close → res のfinishイベントを 受けて socket.destroySoon() を行う。