タグ

programmingとTCPに関するmsakamoto-sfのブックマーク (2)

  • ソケットプログラミングのTips

    概要 ソケットプログラミングに関するTipsをメモレベルで記載する。 切断検知と経路切断 TCPコネクションの切断検出 対向がclose()、shuttdown()、プログラム終了等をしたときの切断検出について。 OSをシャットダウンさせた場合も通常はアプリケーションの終了処理が走り、正常な切断が動く。 受信側の切断検出は、recv()がlength==0で返ってきたとき、または、errno==ECONNRESETとなる。(ECONNRESETはRSTによって切断された場合) 送信側の切断検出は、切断された後2回目のsend()がエラーとなる。 ※相手がclose()→こちらがsend()→相手にパケットが飛ぶが待ち受けプログラムがいないためRST応答が来る→もう1度send()→エラー ※send()自体はカーネルの送信バッファにデータコピーするだけなので、TCPレベルの応答(送信完了)

    ソケットプログラミングのTips
  • Low-Level Academy

    In this course, you will learn how to work with the UDP and TCP internet protocols in real-world scenarios. You will apply your skills to build small, fun networking applications in Rust — right in your browser! No previous knowledge of network programming is required, but we assume that you are familiar with Rust syntax. If you’re not, that's fine too! You can read The Rust Book and learn by prac

    Low-Level Academy
  • 1