Binding.ReceiveTimeout Propriedade

Definição

Obtém ou define o intervalo de tempo que uma conexão pode permanecer inativa, durante o qual nenhuma mensagem de aplicativo é recebida, antes de seu descarte.Gets or sets the interval of time that a connection can remain inactive, during which no application messages are received, before it is dropped.

public:
 property TimeSpan ReceiveTimeout { TimeSpan get(); void set(TimeSpan value); };
public TimeSpan ReceiveTimeout { get; set; }
member this.ReceiveTimeout : TimeSpan with get, set
Public Property ReceiveTimeout As TimeSpan

Valor da propriedade

TimeSpan

O TimeSpan que especifica por quanto tempo o aplicativo precisa receber uma mensagem antes de atingir o tempo limite. O valor padrão é 10 minutos.The TimeSpan that specifies how long the application has to receive a message before timing out. The default value is 10 minutes.

Exceções

O valor é menor que zero ou é muito grande.The value is less than zero or too large.

Comentários

Ao usar uma sessão confiável, há dois timers de inatividade diferentes que devem ser satisfeitos para manter a conexão ativa.When using a reliable session, there are two different inactivity timers that must be satisfied to keep the connection alive. Se um desses temporizadores de inatividade for desligado, a conexão será descartada.If either of these inactivity timers goes off, then the connection is dropped.

  • O primeiro temporizador de inatividade está na sessão confiável e é chamado de InactivityTimeout .The first inactivity timer is on the reliable session and is called the InactivityTimeout. Esse timer de inatividade é acionado se nenhuma mensagem, aplicativo ou infraestrutura, são recebidos dentro do período de tempo limite.This inactivity timer fires if no messages, either application or infrastructure, are received within the timeout period. Uma mensagem de infraestrutura é uma mensagem que é gerada para a finalidade de um dos protocolos na pilha de canais, como um Keep Alive ou uma confirmação, em vez de conter dados de aplicativo.An infrastructure message is a message that is generated for the purpose of one of the protocols in the channel stack, such as a keep alive or an acknowledgment, rather than containing application data.

  • O segundo temporizador de inatividade está no serviço e usa a ReceiveTimeout configuração da associação.The second inactivity timer is on the service and uses the ReceiveTimeout setting of the binding. Esse timer de inatividade é acionado se nenhuma mensagem de aplicativo for recebida dentro do período de tempo limite.This inactivity timer fires if no application messages are received within the timeout period. Isso especifica, por exemplo, o tempo máximo que um cliente pode levar para enviar pelo menos uma mensagem para o servidor antes que o servidor feche o canal usado por uma sessão.This specifies, for example, the maximum time a client may take to send at least one message to the server before the server will close the channel used by a session. Esse comportamento garante que os clientes não possam manter os recursos do servidor por longos períodos arbitrários.This behavior ensures that clients cannot hold on to server resources for arbitrary long periods.

Como a conexão será descartada se o temporizador inatividade for acionado, aumentando InactivityTimeout assim que ReceiveTimeout não tiver nenhum efeito.Since the connection is dropped if either inactivity timer fires, increasing InactivityTimeout once it is greater than ReceiveTimeout has no effect. O padrão para ambos os tempos limite é de 10 minutos, portanto, você sempre precisa aumentar ambos para fazer uma diferença ao usar uma sessão confiável.The default for both of these timeouts is 10 minutes, so you always have to increase both of them to make a difference when using a reliable session.

Se o fluxo de transações estiver habilitado na associação ou no canal, a operação poderá levar mais tempo para ser executada do que o tempo limite especificado.If transaction flow is enabled on the binding or the channel, the operation may take longer to execute than the specified timeout. Nessas circunstâncias, a operação falha devido ao tempo limite expirado e a transação é anulada adequadamente.In these circumstances the operation fails due to the expired timeout and the transaction aborts appropriately.

Quando a segurança é usada com sessões, o ReceiveTimeout valor definido na associação também é usado como tempo limite da sessão.When security is used with sessions, the ReceiveTimeout value set on the binding is also used as the session timeout.

Aplica-se a