Edit

Share via


CollaborationPlatform.BeginShutdown(AsyncCallback, Object) Method

Definition

Shuts down the platform and all known endpoints.

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

Parameters

userCallback
AsyncCallback

The method to be called when the asynchronous operation is completed.

state
Object

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

Returns

An IAsyncResult that references the asynchronous operation.

Examples

The example shows how to shutdown a platform. The example assumes that a platform was previously started successfully. Applications can always attempt to shutdown a platform without error even if it is already shut down.

C# Platform uninitialization


platform.BeginShutdown(this.PlatformShutdownCompleted, platform /*state*/);


private void PlatformShutdownCompleted(IAsyncResult result)
{
    // Platform shutdown never throws, but EndShutdown needs to be called
    // to ensure resources are freed.
    CollaborationPlatform platform = result.AsyncState as CollaborationPlatform;
    platform.EndShutdown(result);
    Console.WriteLine("Platform shutdown completed.");

}


Remarks

When it is shut down, the platform terminates all the endpoints and frees all its resources. The platform cannot be used after this completes.

This operation should never throw.

Applies to