C言語(gcc, WIN32) [2005-01-16/2007-04-16] Visual C++(MFC) [2005-01-16/2006-08-23] Java [2005-01-16/2007-03-02] C# [2006-03-04/2007-03-29]
このページではBerkeley SOCKET、Winsock及びJava Socketのプログラミングについて紹介する。SOCKETも好きだな。 記述例およびサンプルに含まれるファイルの全部、または一部を使用したことによる損害等について、一切の責任を負いません。また、サンプルの文字コードはS-JISで提供しますので、ご使用の際はWindowsからFTPするなどして適切な文字コードに変換してください。尚、サンプル中には説明の簡略化のため意味のないコードや、実用上問題のあるコードも含まれていますのでご注意ください。 [UNIX]スレッドでrecv [UNIX]selectを使う [Winsock]スレッドでrecv [Winsock]selectを使う [Winsock]イベントを使う [Java]Socket(クライアント) [Java]ServerSocket(サーバー) [UNIX]スレ
Previous Next Table of Contents 2. クライアントとサーバ(TCP/SOCK_STREAM)両方に関する質問 2.1 相手側のソケットが閉じられたことをどうやって知ることができますか? Andrew Gierth 氏 ( andrew@erlenstar.demon.co.uk) より: 私の知る限り… 相手側が (SO_LINGER を使ったややこしいことをしないで) close() するか終了したとすると、こちらの read() の呼び 出しは 0 を返すはずです。同じ場合で、write() 呼び出しで何が 起こるかは、もうちょっとわかりづらいです。直後の呼び出し時ではな く、その次の呼び出し時にEPIPE が返るでしょう。 もし相手が再起動するか l_onoff = 1, l_linger = 0 を設定して から閉じたとすると、read() からは(
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く