ApplicationEndpoint.BeginDrain(AsyncCallback, Object) Method

Definition

Starts declining requests for new conversations on the endpoint.

public:
 IAsyncResult ^ BeginDrain(AsyncCallback ^ userCallback, System::Object ^ state);
public IAsyncResult BeginDrain (AsyncCallback userCallback, object state);
member this.BeginDrain : AsyncCallback * obj -> IAsyncResult
Public Function BeginDrain (userCallback As AsyncCallback, state As Object) As IAsyncResult

Parameters

userCallback
AsyncCallback

The method to be called when all conversations have been terminated or the endpoint exits the Draining state.

state
Object

A user-provided object that distinguishes this particular asynchronous operation from other asynchronous operations.

Returns

An IAsyncResult that references the asynchronous operation.

Exceptions

Thrown when the state of the endpoint is not Established or Reestablishing.

Remarks

Upon calling the method the endpoint enters the Draining state. In this state new conversations are declined while calls on existing conversations continue to be accepted. When no outstanding conversations remain, the callback is invoked. Application would normally terminate the endpoint after the callback is invoked. However, it is free to terminate the endpoint at any time.

Applies to