Поделиться через


ServicePoint.IdleSince Свойство

Определение

Возвращает дату и время последнего подключения объекта ServicePoint к узлу.

public:
 property DateTime IdleSince { DateTime get(); };
public DateTime IdleSince { get; }
member this.IdleSince : DateTime
Public ReadOnly Property IdleSince As DateTime

Значение свойства

Объект DateTime, который содержит дату и время последнего подключения объекта ServicePoint.

Примеры

В следующем примере кода свойство используется для IdleSince задания и получения даты и времени 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()))

Комментарии

Свойство IdleSince записывает дату и время, когда точка обслуживания была отключена от узла. Если разница между текущим временем и IdleSince превышает значение , ServicePoint объект доступен для повторного MaxIdleTimeиспользования в другом соединении.

Применяется к