示例#1
0
        async void OnDestroy()
        {
            // Clean up Hub and channel
            shutdownCancellation.Cancel();

            await streamingClient.DisposeAsync();

            await channel.ShutdownAsync();
        }
        private async void _shutdown()
        {
            try
            {
                if (IsJoin)
                {
                    await _chatHub.LeaveChat();
                }
            }
            catch
            {
                // ignored
            }

            try
            {
                await _chatHub.DisposeAsync();
            }
            catch (Exception e)
            {
                // ignored
            }
        }
示例#3
0
 public async Task DisposeAsync() => await chatHub.DisposeAsync();
 async Task IHubClient.DisconnectHubAsync()
 {
     await _streamingHub.DisposeAsync();
 }