ServicePoint.IdleSince Propriedade

Definição

Obtém a data e a hora em que o objeto ServicePoint estava conectado 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 da propriedade

Um DateTime objeto que contém a data e a hora em que o ServicePoint objeto foi conectado pela última vez.

Exemplos

O exemplo de código a seguir usa a IdleSince propriedade para definir e recuperar a data e a hora em que o ServicePoint objeto foi conectado pela última vez a um host.

// 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()))

Comentários

A IdleSince propriedade registra a última data e hora em que um ponto de serviço foi desconectado de um host. Quando a diferença entre a hora atual e IdleSince excede o valor de MaxIdleTime, o ServicePoint objeto está disponível para reciclagem para outra conexão.

Aplica-se a