ServicePoint.MaxIdleTime プロパティ
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
ServicePoint オブジェクトに関連付けられた接続がアイドル状態を持続できる時間を取得または設定します。この時間が経過すると、接続は閉じられます。
public:
property int MaxIdleTime { int get(); void set(int value); };
public int MaxIdleTime { get; set; }
member this.MaxIdleTime : int with get, set
Public Property MaxIdleTime As Integer
プロパティ値
ServicePoint オブジェクトに関連付けられた接続が閉じられて別の接続で再利用されるまでにアイドル状態を持続できる時間 (ミリ秒単位)。
例外
MaxIdleTimeが Int32.MaxValue より小さいInfiniteか、より大きいに設定されています。
例
次のコード例では、 プロパティを MaxIdleTime 使用してアイドル時間を設定および取得します ServicePoint 。
// Display the date and time that the ServicePoint was last
// connected to a host.
Console::WriteLine( "IdleSince = {0}", sp->IdleSince );
// Display the maximum length of time that the ServicePoint instance
// is allowed to maintain an idle connection to an Internet
// resource before it is recycled for use in another connection.
Console::WriteLine( "MaxIdleTime = {0}", sp->MaxIdleTime );
// Display the date and time that the ServicePoint was last
// connected to a host.
Console.WriteLine("IdleSince = " + sp.IdleSince.ToString());
// Display the maximum length of time that the ServicePoint instance
// is allowed to maintain an idle connection to an Internet
// resource before it is recycled for use in another connection.
Console.WriteLine("MaxIdleTime = " + sp.MaxIdleTime);
' Display the date and time that the ServicePoint was last
' connected to a host.
Console.WriteLine(("IdleSince = " + sp.IdleSince.ToString()))
' Display the maximum length of time that the ServicePoint instance
' is allowed to maintain an idle connection to an Internet
' resource before it is recycled for use in another connection.
Console.WriteLine(("MaxIdleTime = " + sp.MaxIdleTime.ToString()))
注釈
を にTimeout.Infinite設定MaxIdleTimeすると、オブジェクトに関連付けられている接続がServicePointタイムアウトになることはありません。
プロパティの MaxIdleTime 既定値は、オブジェクトの作成時の ServicePointManager.MaxServicePointIdleTime プロパティの ServicePoint 値です。 プロパティに対する後続の MaxServicePointIdleTime 変更は、既存 ServicePoint のオブジェクトには影響しません。
MaxIdleTimeに関連付ServicePointけられている接続の を超えた場合、アプリケーションが接続の使用を試みるまで、接続は開いたままです。 その時点で、フレームワークは接続を閉じ、リモート ホストへの新しい接続を作成します。
適用対象
.NET
フィードバック
https://aka.ms/ContentUserFeedback」を参照してください。
以下は間もなく提供いたします。2024 年を通じて、コンテンツのフィードバック メカニズムとして GitHub の issue を段階的に廃止し、新しいフィードバック システムに置き換えます。 詳細については、「フィードバックの送信と表示