Este artigo foi traduzido por máquina. Coloque o ponteiro do mouse sobre as frases do artigo para ver o texto original. Mais informações.
Tradução
Original
Este tópico ainda não foi avaliado como - Avalie este tópico

ServicePoint.ConnectionLeaseTimeout Propriedade

Gets or sets the number of milliseconds after which an active ServicePoint connection is closed.

Namespace:  System.Net
Assembly:  System (em System. dll)
public int ConnectionLeaseTimeout { get; set; }

Valor da propriedade

Tipo: System.Int32
A Int32 that specifies the number of milliseconds that an active ServicePoint connection remains open.The default is -1, which allows an active ServicePoint connection to stay connected indefinitely.Set this property to 0 to force ServicePoint connections to close after servicing a request.
ExceçãoCondição
ArgumentOutOfRangeException

O valor especificado para uma operação conjunto é um número negativo menor que-1.

You can use this property to ensure that a ServicePoint object's active connections do not remain open indefinitely.Esta propriedade destina-se de cenários onde conexões devem ser descartadas e restabelecidas periodicamente, como Carregar balancear cenários.

By default, when KeepAlive is true for a request, the MaxIdleTime property sets the time-out for closing ServicePoint connections due to inactivity.If the ServicePoint has active connections, MaxIdleTime has no effect and the connections remain open indefinitely.

When the ConnectionLeaseTimeout property is set to a value other than -1, and after the specified time elapses, an active ServicePoint connection is closed after servicing a request by setting KeepAlive to false in that request.

Setting this value affects all connections managed by the ServicePoint object.

O exemplo de código a seguir define o valor dessa propriedade.

Isso foi útil para você?
(1500 caracteres restantes)

Contribuições da comunidade

ADICIONAR
© 2013 Microsoft. Todos os direitos reservados.