CollaborationPlatform.BeginShutdown Method
Shuts down the platform and all known endpoints.
Namespace: Microsoft.Rtc.Collaboration
Assembly: Microsoft.Rtc.Collaboration (in Microsoft.Rtc.Collaboration.dll)
Syntax
'Declaration
Public Function BeginShutdown ( _
userCallback As AsyncCallback, _
state As Object _
) As IAsyncResult
'Usage
Dim instance As CollaborationPlatform
Dim userCallback As AsyncCallback
Dim state As Object
Dim returnValue As IAsyncResult
returnValue = instance.BeginShutdown(userCallback, _
state)
public IAsyncResult BeginShutdown(
AsyncCallback userCallback,
Object state
)
Parameters
- userCallback
Type: System.AsyncCallback
The method to be called when the asynchronous operation is completed.
- state
Type: System.Object
A user-provided object that distinguishes this particular asynchronous operation from other asynchronous operations.
Return Value
Type: System.IAsyncResult
An IAsyncResult that references the asynchronous operation.
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.
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.");
}