ServicePointManager.MaxServicePointIdleTime 속성

정의

ServicePoint 개체의 최대 유휴 시간을 가져오거나 설정합니다.

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

속성 값

ServicePoint 개체의 최대 유휴 시간(밀리초)입니다. 기본값은 100,000밀리초(100초)입니다.

예외

예제

다음 코드 예제에서는이 속성을 설정합니다.

// 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 최대 유휴 시간을 설정합니다. 이 값에 대한 변경 내용은 값이 변경된 후 초기화된 개체에만 ServicePoint 영향을 미칩니다.

개체가 ServicePointMaxIdleTime지정된 시간 동안 유휴 상태가 된 후에는 가비지 수집에 적합합니다. ServicePoint 개체와 연결된 연결 목록이 비어 있으면 개체가 ServicePoint 유휴 상태입니다.

적용 대상

추가 정보