Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Node.js道場:第1回Node.js入門勉強会課題レポート解答のヒント
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Shigeki Ohtsu
December 04, 2012
3
460
Node.js道場:第1回Node.js入門勉強会課題レポート解答のヒント
Shigeki Ohtsu
December 04, 2012
Tweet
Share
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
2k
Signed HTTP Exchanges (SXG)とはなにか/SXG Explained
shigeki
10
3.5k
Webプロトコル最前線
shigeki
0
510
運用の観点から見たTLSプロトコルの動き
shigeki
0
1.6k
祝Node-v10リリース これまでのNodeの振り返り
shigeki
7
3.6k
運用の観点から見たTLSプロトコルの動き
shigeki
14
3.9k
IETF QUICに至るプロトコルの透過性問題とその対策
shigeki
3
1.2k
QUIC WG報告
shigeki
4
1.2k
Featured
See All Featured
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Mobile First: as difficult as doing things right
swwweet
225
10k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
140
Technical Leadership for Architectural Decision Making
baasie
3
290
A Tale of Four Properties
chriscoyier
163
24k
The Cult of Friendly URLs
andyhume
79
6.8k
Designing for humans not robots
tammielis
254
26k
A Soul's Torment
seathinner
5
2.5k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
150
Done Done
chrislema
186
16k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
290
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() を行う。