Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

IReplyChannel::BeginReceiveRequest Method (AsyncCallback^, Object^)

 

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

Namespace:   System.ServiceModel.Channels
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

IAsyncResult^ BeginReceiveRequest(
	AsyncCallback^ callback,
	Object^ state
)

Parameters

callback
Type: System::AsyncCallback^

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

state
Type: System::Object^

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

Return Value

Type: System::IAsyncResult^

The IAsyncResult that references the asynchronous reception of the request.

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.

The following code illustrates how to implement this method:

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

.NET Framework
Available since 3.0
Return to top
Show:
© 2017 Microsoft