TcpClient.SendTimeout プロパティ
アセンブリ: System (system.dll 内)

Dim instance As TcpClient Dim value As Integer value = instance.SendTimeout instance.SendTimeout = value
/** @property */ public int get_SendTimeout () /** @property */ public void set_SendTimeout (int value)
ミリ秒単位の送信タイムアウト値。既定値は 0 です。

SendTimeout プロパティは、正常に終了できるまで Send メソッドがブロックする時間を決定します。時間の単位はミリ秒です。
Write メソッドを呼び出すと、基になる Socket はホストに実際に送信されたバイト数を返します。SendTimeout プロパティは、返されたバイト数を受信する前に TcpClient が待機する時間を決定します。Send メソッドが正常に完了する前にタイムアウトが発生した場合、TcpClient は SocketException をスローします。既定では、タイムアウトは発生しません。
Windows Mobile for Pocket PC、Windows Mobile for Smartphone、Windows CE プラットフォームメモ : .NET Compact Framework アプリケーションでは、SendTimeout 列挙値はサポートされていますが、今後使用するために予約されています。SendTimeout プロパティはこの列挙値を使用するため、.NET Compact Framework の今後のリリースでその列挙値が使用できるようになるまで、SocketException が発生します。

SendTimeout 値を設定および取得するコード例を次に示します。
' Sets the send time out using the SendTimeout public property. tcpClient.SendTimeout = 5000 ' Gets the send time out using the SendTimeout public property. If tcpClient.SendTimeout = 5000 Then Console.WriteLine(("The send time out limit was successfully set " + tcpClient.SendTimeout.ToString())) End If
// sets the send time out using the SendTimeout public property. tcpClient.SendTimeout = 5; // gets the send time out using the SendTimeout public property. if (tcpClient.SendTimeout == 5) Console.WriteLine ("The send time out limit was successfully set " + tcpClient.SendTimeout.ToString ());
// sets the send time out using the SendTimeout public property. tcpClient->SendTimeout = 5; // gets the send time out using the SendTimeout public property. if ( tcpClient->SendTimeout == 5 ) Console::WriteLine( "The send time out limit was successfully set {0}", tcpClient->SendTimeout );
// sets the send time out using the SendTimeout public property. tcpClient.set_SendTimeout(5); // gets the send time out using the SendTimeout public property. if (tcpClient.get_SendTimeout() == 5) { Console.WriteLine("The send time out limit was successfully set " + ((Int32)tcpClient.get_SendTimeout()).ToString()); }

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からTcpClient.SendTimeout プロパティを検索する場合は、下記のリンクをクリックしてください。

- TcpClient.SendTimeout プロパティのページへのリンク