ServicePointManager.MaxServicePointIdleTime プロパティ

定義

ServicePoint オブジェクトの最大アイドル時間を取得または設定します。Gets or sets the maximum idle time of a ServicePoint object.

public:
 static property int MaxServicePointIdleTime { int get(); void set(int value); };
public static int MaxServicePointIdleTime { get; set; }
member this.MaxServicePointIdleTime : int with get, set
Public Shared Property MaxServicePointIdleTime As Integer

プロパティ値

ServicePoint オブジェクトのミリ秒単位の最大アイドル時間。The maximum idle time, in milliseconds, of a ServicePoint object. 既定値は 100,000 ミリ秒 (100 秒) です。The default value is 100,000 milliseconds (100 seconds).

例外

MaxServicePointIdleTimeInfinite より小さいか MaxValue より大きいです。MaxServicePointIdleTime is less than Infinite or greater than MaxValue.

このプロパティを設定するコード例を次に示します。The following code example sets this property.

// Set the maximum number of ServicePoint instances to 
// maintain. If a ServicePoint instance for that host already 
// exists when your application requests a connection to
// an Internet resource, the ServicePointManager object
// returns this existing ServicePoint instance. If none exists 
// for that host, it creates a new ServicePoint instance.
ServicePointManager::MaxServicePoints = 4;

// Set the maximum idle time of a ServicePoint instance to 10 seconds.
// After the idle time expires, the ServicePoint object is eligible for
// garbage collection and cannot be used by the ServicePointManager.
ServicePointManager::MaxServicePointIdleTime = 10000;

// Set the maximum number of ServicePoint instances to 
// maintain. If a ServicePoint instance for that host already 
// exists when your application requests a connection to
// an Internet resource, the ServicePointManager object
// returns this existing ServicePoint instance. If none exists 
// for that host, it creates a new ServicePoint instance.
ServicePointManager.MaxServicePoints = 4;

// Set the maximum idle time of a ServicePoint instance to 10 seconds.
// After the idle time expires, the ServicePoint object is eligible for
// garbage collection and cannot be used by the ServicePointManager object.
ServicePointManager.MaxServicePointIdleTime = 10000;
' Set the maximum number of ServicePoint instances to maintain.
' Note that, if a ServicePoint instance for that host already 
' exists when your application requests a connection to
' an Internet resource, the ServicePointManager object
' returns this existing ServicePoint. If none exists 
' for that host, it creates a new ServicePoint instance.
ServicePointManager.MaxServicePoints = 4

' Set the maximum idle time of a ServicePoint instance to 10 seconds.
' After the idle time expires, the ServicePoint object is eligible for
' garbage collection and cannot be used by the ServicePointManager.
ServicePointManager.MaxServicePointIdleTime = 10000

注釈

MaxServicePointIdleTime プロパティは ServicePoint オブジェクトを作成するときに ServicePointManager オブジェクトが MaxIdleTime プロパティに割り当てる最大アイドル時間を設定します。The MaxServicePointIdleTime property sets the maximum idle time that the ServicePointManager object assigns to the MaxIdleTime property when creating ServicePoint objects. この値への変更は、値が変更された後に初期化される ServicePoint のオブジェクトにのみ影響します。Changes to this value affect only ServicePoint objects that are initialized after the value is changed.

ServicePoint オブジェクトが MaxIdleTimeで指定された時間アイドル状態になると、ガベージコレクションの対象になります。After a ServicePoint object has been idle for the time specified in MaxIdleTime, it is eligible for garbage collection. ServicePoint オブジェクトに関連付けられている接続の一覧が空の場合、ServicePoint オブジェクトはアイドル状態になります。A ServicePoint object is idle when the list of connections associated with the ServicePoint object is empty.

セキュリティ

WebPermission
無制限の Web アクセス許可の場合。For unrestricted Web permissions. 関連付けられた列挙型: UnrestrictedAssociated enumeration: Unrestricted

適用対象

こちらもご覧ください