ServicePoint.IdleSince Propriedade
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Obtém a data e hora em que o ServicePoint objeto foi ligado pela última vez a um host.
public:
property DateTime IdleSince { DateTime get(); };
public DateTime IdleSince { get; }
member this.IdleSince : DateTime
Public ReadOnly Property IdleSince As DateTime
Valor de Propriedade
Um DateTime objeto que contém a data e hora em que o ServicePoint objeto foi ligado pela última vez.
Exemplos
O exemplo de código seguinte utiliza a IdleSince propriedade para definir e recuperar a data e hora em que o ServicePoint objeto foi ligado pela última vez a um host.
// 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()))
Observações
Atenção
WebRequest, HttpWebRequest, ServicePoint, e WebClient são obsoletos, e não deves usá-los para novos desenvolvimentos. Utilize HttpClient em substituição.
A IdleSince propriedade regista a última data e hora em que um ponto de serviço foi desligado de um hospedeiro. Quando a diferença entre o tempo atual e IdleSince excede o valor de MaxIdleTime, o ServicePoint objeto está disponível para reciclagem para outra ligação.