changes to use dispose

This commit is contained in:
Luke Brown
2022-05-16 22:09:41 -05:00
parent 8bb4cd017c
commit a64eebe79f
9 changed files with 84 additions and 58 deletions

View File

@@ -1363,26 +1363,9 @@ namespace Emby.Server.Implementations.Session
{
CheckDisposed();
await CloseAllWebSockets(cancellationToken).ConfigureAwait(false);
await SendMessageToSessions(Sessions, SessionMessageType.ServerShuttingDown, string.Empty, cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// Gracefully closes all web sockets in all sessions.
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
private async Task CloseAllWebSockets(CancellationToken cancellationToken)
{
foreach (var session in Sessions)
{
foreach (var sessionController in session.SessionControllers)
{
await sessionController.CloseAllWebSockets(cancellationToken).ConfigureAwait(false);
}
}
}
/// <summary>
/// Sends the server restart notification.
/// </summary>