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::ReceiveRequest Method (TimeSpan)

 

Returns the context of the request received, if one is available. If a context is not available, waits until there is one available.

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

RequestContext^ ReceiveRequest(
	TimeSpan timeout
)

Parameters

timeout
Type: System::TimeSpan

The TimeSpan that specifies how long the receive of a request operation has to complete before timing out and returning false.

Return Value

Type: System.ServiceModel.Channels::RequestContext^

The RequestContext used to construct replies.

RequestContext encapsulates the request message and a mechanism for replying to that message.

ReceiveRequest can be called multiple times or concurrently. Only one ReceiveRequest call completes per request received.

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 RequestContext ReceiveRequest(TimeSpan timeout)
{
    RequestContext requestContext;
    while (true)
    {
        requestContext = this.InnerChannel.ReceiveRequest(timeout);
        if (ProcessRequestContext(ref requestContext))
        {
            break;
        }
    }

    return requestContext;
}

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