Gets or sets the maximum idle time of a ServicePoint object.
Assembly: System (in System.dll)
The property sets the maximum idle time that the ServicePointManager object assigns to the MaxIdleTime property when creating ServicePoint objects. Changes to this value affect only ServicePoint objects that are initialized after the value is changed.
After a ServicePoint object has been idle for the time specified in MaxIdleTime, it is eligible for garbage collection. A ServicePoint object is idle when the list of connections associated with the ServicePoint object is empty.
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 object. ServicePointManager.MaxServicePointIdleTime = 10000;
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.