ApplicationEndpoint.BeginDrain(AsyncCallback, Object) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.