ServicePointManager.MaxServicePoints-Eigenschaft
Ruft die maximale Anzahl von ServicePoint-Objekten ab, die jederzeit verwaltet werden sollen, oder legt diese fest.
Namespace: System.Net
Assembly: System (in system.dll)
Syntax
'Declaration
Public Shared Property MaxServicePoints As Integer
'Usage
Dim value As Integer
value = ServicePointManager.MaxServicePoints
ServicePointManager.MaxServicePoints = value
public static int MaxServicePoints { get; set; }
public:
static property int MaxServicePoints {
int get ();
void set (int value);
}
/** @property */
public static int get_MaxServicePoints ()
/** @property */
public static void set_MaxServicePoints (int value)
public static function get MaxServicePoints () : int
public static function set MaxServicePoints (value : int)
Eigenschaftenwert
Die maximale Anzahl der zu verwaltenden ServicePoint-Objekte. Der Standardwert ist 0, d. h., dass die Anzahl der ServicePoint-Objekte unbegrenzt ist.
Ausnahmen
Ausnahmetyp | Bedingung |
---|---|
MaxServicePoints ist kleiner als 0 oder größer als Int32.MaxValue. |
Hinweise
Wenn Sie die MaxServicePoints-Eigenschaft auf eine niedrigere Anzahl als die der gegenwärtig vorhandenen ServicePoint-Objekte festlegen, löscht der ServicePointManager die ServicePoint-Objekte mit den längsten Leerlaufzeiten. Wenn die Anzahl der ServicePoint-Objekte mit aktiven Verbindungen größer als der Wert von MaxServicePoints ist, löscht das ServicePointManager-Objekt die ServicePoint-Objekte, sobald sich diese im Leerlauf befinden.
Beispiel
Im folgenden Codebeispiel wird diese Eigenschaft festgelegt.
' 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
// 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. 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.set_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.set_MaxServicePointIdleTime(10000);
.NET Framework-Sicherheit
- WebPermission für uneingeschränkte Webberechtigungen. Zugeordnete Enumeration: Unrestricted
Plattformen
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile für Pocket PC, Windows Mobile für Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.
Versionsinformationen
.NET Framework
Unterstützt in: 2.0, 1.1, 1.0
Siehe auch
Referenz
ServicePointManager-Klasse
ServicePointManager-Member
System.Net-Namespace