แก้ไข

แชร์ผ่าน


IReplyChannel.BeginReceiveRequest Method

Definition

Begins an asynchronous operation to receive an available request.

Overloads

BeginReceiveRequest(AsyncCallback, Object)

Begins an asynchronous operation to receive an available request with a default timeout.

BeginReceiveRequest(TimeSpan, AsyncCallback, Object)

Begins an asynchronous operation to receive an available request with a specified timeout.

BeginReceiveRequest(AsyncCallback, Object)

Source:
IReplyChannel.cs
Source:
IReplyChannel.cs

Begins an asynchronous operation to receive an available request with a default timeout.

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

Parameters

callback
AsyncCallback

The AsyncCallback delegate that receives the notification of the asynchronous receive that a request operation completes.

state
Object

An object, specified by the application, that contains state information associated with the asynchronous receive of a request operation.

Returns

The IAsyncResult that references the asynchronous reception of the request.

Examples

The following code illustrates how to implement this method:

public IAsyncResult BeginReceiveRequest(AsyncCallback callback, object state)
{
    return BeginReceiveRequest(DefaultReceiveTimeout, callback, state);
}

Remarks

The BeginReceiveRequest(AsyncCallback, Object) method implements the standard pattern for invoking ReceiveRequest() asynchronously. The default timeout is 1 minute. If a receive timeout is set on the binding used to configure the connection, then that value is used. Use BeginReceiveRequest(TimeSpan, AsyncCallback, Object) if you want to specify an explicit timeout with the call that overrides these other values.

If the request message received is larger that the maximum message size allowed by the binding being used, a QuotaExceededException is thrown. The maximum message size is set by the MaxReceivedMessageSize property. The default value is 65536 bytes.

Applies to

BeginReceiveRequest(TimeSpan, AsyncCallback, Object)

Source:
IReplyChannel.cs
Source:
IReplyChannel.cs

Begins an asynchronous operation to receive an available request with a specified timeout.

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

Parameters

timeout
TimeSpan

The TimeSpan that specifies the interval of time to wait for the reception of an available request.

callback
AsyncCallback

The AsyncCallback delegate that receives the notification of the asynchronous receive that a request operation completes.

state
Object

An object, specified by the application, that contains state information associated with the asynchronous receive of a request operation.

Returns

The IAsyncResult that references the asynchronous reception of the request.

Examples

The following code illustrates how to implement this method:

public IAsyncResult BeginReceiveRequest(TimeSpan timeout, AsyncCallback callback, object state)
{
    ReceiveRequestAsyncResult result = new ReceiveRequestAsyncResult(this, timeout, callback, state);
    result.Begin();
    return result;
}

Remarks

The BeginReceiveRequest(TimeSpan, AsyncCallback, Object) method implements the standard pattern for invoking ReceiveRequest(TimeSpan) asynchronously. The timeout set on this method overrides a receive timeout set on the binding that is used to configure the connection.

If the request message received is larger that the maximum message size allowed by the binding being used, a QuotaExceededException is thrown. The maximum message size is set by the MaxReceivedMessageSize property. The default value is 65536 bytes.

Applies to