ServicePoint.MaxIdleTime 속성

정의

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 개체와 관련된 연결이 닫히고 다른 연결에 다시 사용되기 전까지 유휴 상태를 유지할 수 있는 시간(밀리초)입니다.

예외

MaxIdleTimeInt32.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()))

설명

를 로 설정 MaxIdleTimeTimeout.Infinite 하여 개체와 연결된 연결이 ServicePoint 시간 초과되지 않아야 함을 나타낼 수 있습니다.

속성의 MaxIdleTime 기본값은 개체를 ServicePointManager.MaxServicePointIdleTime 만들 때 ServicePoint 속성의 값입니다. 속성에 대한 MaxServicePointIdleTime 후속 변경 내용은 기존 ServicePoint 개체에 영향을 주지 않습니다.

경우는 MaxIdleTime 관련 된 연결에 대 한는 ServicePoint 는 초과 연결이 열려 애플리케이션에서 연결을 사용 하려고 할 때까지 합니다. 이때 프레임워크는 연결을 닫고 원격 호스트에 대한 새 연결을 만듭니다.

적용 대상