ServicePointManager.MaxServicePointIdleTime Eigenschaft
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Ruft die maximale Leerlaufzeit eines ServicePoint-Objekts ab oder legt diese fest.
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
Eigenschaftswert
Die maximale Leerlaufzeit eines ServicePoint-Objekts in Millisekunden. Der Standardwert ist 100.000 Millisekunden (100 Sekunden).
Ausnahmen
MaxServicePointIdleTime ist kleiner als oder größer als Infinite Int32.MaxValue.
Beispiele
Im folgenden Codebeispiel wird diese Eigenschaft festgelegt.
// 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
Hinweise
Die MaxServicePointIdleTime Eigenschaft legt beim Erstellen ServicePoint von Objekten die maximale Leerlaufzeit fest, die das ServicePointManager Objekt der MaxIdleTime Eigenschaft zuweist. Änderungen an diesem Wert wirken sich nur ServicePoint auf Objekte aus, die initialisiert werden, nachdem der Wert geändert wurde.
Nachdem ein ServicePoint Objekt zum angegebenen Zeitpunkt MaxIdleTimeleer ist, ist es für die Garbage Collection berechtigt. Ein ServicePoint Objekt ist leer, wenn die Liste der Verbindungen, die dem ServicePoint Objekt zugeordnet sind, leer ist.