IReplyChannel.BeginWaitForRequest(TimeSpan, AsyncCallback, Object) Método

Definição

Inicia uma operação de solicitação assíncrona que tem um tempo limite e um objeto de estado especificados associados.Begins an asynchronous request operation that has a specified time out and state object associated with it.

public:
 IAsyncResult ^ BeginWaitForRequest(TimeSpan timeout, AsyncCallback ^ callback, System::Object ^ state);
public IAsyncResult BeginWaitForRequest (TimeSpan timeout, AsyncCallback callback, object state);
abstract member BeginWaitForRequest : TimeSpan * AsyncCallback * obj -> IAsyncResult
Public Function BeginWaitForRequest (timeout As TimeSpan, callback As AsyncCallback, state As Object) As IAsyncResult

Parâmetros

timeout
TimeSpan

O TimeSpan que especifica o intervalo de tempo de espera para o recebimento de uma solicitação disponível.The TimeSpan that specifies the interval of time to wait for the reception of an available request.

callback
AsyncCallback

O representante de AsyncCallback que recebe a notificação do recebimento assíncrono que uma operação de solicitação conclui.The AsyncCallback delegate that receives the notification of the asynchronous receive that a request operation completes.

state
Object

Um objeto, especificado pelo aplicativo, que contém informações de estado associadas ao recebimento assíncrono de uma operação de solicitação.An object, specified by the application, that contains state information associated with the asynchronous receive of a request operation.

Retornos

IAsyncResult

O IAsyncResult que referencia a operação assíncrona para esperar uma mensagem de solicitação chegar.The IAsyncResult that references the asynchronous operation to wait for a request message to arrive.

Exemplos

O código a seguir ilustra como implementar esse método:The following code illustrates how to implement this method:

public IAsyncResult BeginWaitForRequest(TimeSpan timeout, AsyncCallback callback, object state)
{
    return this.InnerChannel.BeginWaitForRequest(timeout, callback, state);
}

Comentários

Use o WaitForRequest(TimeSpan) método síncrono quando for aceitável que o thread atual seja bloqueado enquanto aguarda uma mensagem de solicitação chegar na fila.Use the synchronous WaitForRequest(TimeSpan) method when it is acceptable for the current thread to be blocked while it waits for a request message to arrive in the queue. O thread está bloqueado até o especificado timeout .The thread is blocked up to the specified timeout.

Esse método recebe a notificação, por meio de um retorno de chamada, da identidade do manipulador de eventos para a operação.This method receives notification, through a callback, of the identity of the event handler for the operation. A operação não será concluída até que uma mensagem de solicitação se torne disponível no canal ou o tempo limite ocorra.The operation is not complete until either a request message becomes available in the channel or the time out occurs.

Notas aos Implementadores

A operação retornará false se o especificado timeout for excedido.The operation returns false if the specified timeout is exceeded.

Aplica-se a