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

Dim instance As TcpClient Dim value As Integer value = instance.ReceiveTimeout instance.ReceiveTimeout = value
/** @property */ public int get_ReceiveTimeout () /** @property */ public void set_ReceiveTimeout (int value)
接続のタイムアウト値 (ミリ秒単位)。既定値は、0 です。

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

受信のタイム アウトを設定および取得するコード例を次に示します。
' Sets the receive time out using the ReceiveTimeout public property. tcpClient.ReceiveTimeout = 5 ' Gets the receive time out using the ReceiveTimeout public property. If tcpClient.ReceiveTimeout = 5 Then Console.WriteLine(("The receive time out limit was successfully set " + tcpClient.ReceiveTimeout.ToString())) End If
// Sets the receive time out using the ReceiveTimeout public property. tcpClient.ReceiveTimeout = 5000; // Gets the receive time out using the ReceiveTimeout public property. if (tcpClient.ReceiveTimeout == 5000) Console.WriteLine ("The receive time out limit was successfully set " + tcpClient.ReceiveTimeout.ToString ());
// Sets the receive time out using the ReceiveTimeout public property. tcpClient->ReceiveTimeout = 5; // Gets the receive time out using the ReceiveTimeout public property. if ( tcpClient->ReceiveTimeout == 5 ) Console::WriteLine( "The receive time out limit was successfully set {0}", tcpClient->ReceiveTimeout );
// Sets the receive time out using the ReceiveTimeout public property. tcpClient.set_ReceiveTimeout(5); // Gets the receive time out using the ReceiveTimeout public property. if (tcpClient.get_ReceiveTimeout() == 5) { Console.WriteLine("The receive time out limit was successfully set " + ((Int32)tcpClient.get_ReceiveTimeout()).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.ReceiveTimeout プロパティを検索する場合は、下記のリンクをクリックしてください。

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