TcpClient.LingerState プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > TcpClient.LingerState プロパティの意味・解説 

TcpClient.LingerState プロパティ

ソケット待機時間に関する情報取得または設定します

名前空間: System.Net.Sockets
アセンブリ: System (system.dll 内)
構文構文

Public Property LingerState As
 LingerOption
Dim instance As TcpClient
Dim value As LingerOption

value = instance.LingerState

instance.LingerState = value
public LingerOption LingerState { get; set;
 }
public:
property LingerOption^ LingerState {
    LingerOption^ get ();
    void set (LingerOption^ value);
}
/** @property */
public LingerOption get_LingerState ()

/** @property */
public void set_LingerState (LingerOption value)
public function get LingerState
 () : LingerOption

public function set LingerState
 (value : LingerOption)

プロパティ
LingerOption。既定では、接続待機無効です。

解説解説
使用例使用例

ソケット待機時間設定し取得するコード例次に示します

' Sets the amount of time to linger after closing, using the LingerOption
 public property.
Dim lingerOption As New
 LingerOption(True, 10)
tcpClient.LingerState = lingerOption

' Gets the amount of linger time set, using the LingerOption public
 property.
If tcpClient.LingerState.LingerTime = 10 Then
   Console.WriteLine(("The linger state setting was successfully
 set to " + tcpClient.LingerState.LingerTime.ToString()))
End If
// sets the amount of time to linger after closing, using the LingerOption
 public property.
LingerOption lingerOption = new LingerOption (true,
 10);

tcpClient.LingerState = lingerOption;

// gets the amount of linger time set, using the LingerOption public
 property.
if (tcpClient.LingerState.LingerTime == 10)
    Console.WriteLine ("The linger state setting was successfully set
 to " + tcpClient.LingerState.LingerTime.ToString ());

// sets the amount of time to linger after closing, using the LingerOption
 public property.
LingerOption^ lingerOption = gcnew LingerOption( true,10 );
tcpClient->LingerState = lingerOption;

// gets the amount of linger time set, using the LingerOption public
 property.
if ( tcpClient->LingerState->LingerTime == 10 )
      Console::WriteLine( "The linger state setting was successfully set
 to {0}", tcpClient->LingerState->LingerTime );


// sets the amount of time to linger after closing, using the
// LingerOption public property.
LingerOption lingerOption = new LingerOption(true,
 10);
tcpClient.set_LingerState(lingerOption);

// gets the amount of linger time set, using the LingerOption public
// property.
if (tcpClient.get_LingerState().get_LingerTime() == 10) {
    Console.WriteLine("The linger state setting was successfully set
 to "
        + ((Int32)tcpClient.get_LingerState().get_LingerTime()).ToString());
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
TcpClient クラス
TcpClient メンバ
System.Net.Sockets 名前空間
LingerOption クラス
Close
Write


このページでは「.NET Framework クラス ライブラリ リファレンス」からTcpClient.LingerState プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からTcpClient.LingerState プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からTcpClient.LingerState プロパティ を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

TcpClient.LingerState プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



TcpClient.LingerState プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS