diff options
| author | Negulici-R. Barnabas <109497789+negulici-r-barnabas@users.noreply.github.com> | 2022-07-25 07:16:04 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-25 07:16:04 +0300 |
| commit | a1f1fd9a5ca193f60ab1833b3f0c91ca68f38bed (patch) | |
| tree | 419f2a8a95f377eca49966fc1f746287a303b709 /Emby.Server.Implementations/Session/WebSocketController.cs | |
| parent | 4fac67c097ac0328fcc5deb1b6264ea3cec4ce5b (diff) | |
| parent | bffda19bbc9d8fe95c864d7315a0c6f6a05d9d7d (diff) | |
Merge branch 'jellyfin:master' into master
Diffstat (limited to 'Emby.Server.Implementations/Session/WebSocketController.cs')
| -rw-r--r-- | Emby.Server.Implementations/Session/WebSocketController.cs | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/Emby.Server.Implementations/Session/WebSocketController.cs b/Emby.Server.Implementations/Session/WebSocketController.cs index d21b6a929..1f3248f07 100644 --- a/Emby.Server.Implementations/Session/WebSocketController.cs +++ b/Emby.Server.Implementations/Session/WebSocketController.cs @@ -14,7 +14,7 @@ using Microsoft.Extensions.Logging; namespace Emby.Server.Implementations.Session { - public sealed class WebSocketController : ISessionController, IDisposable + public sealed class WebSocketController : ISessionController, IAsyncDisposable, IDisposable { private readonly ILogger<WebSocketController> _logger; private readonly ISessionManager _sessionManager; @@ -99,6 +99,23 @@ namespace Emby.Server.Implementations.Session foreach (var socket in _sockets) { socket.Closed -= OnConnectionClosed; + socket.Dispose(); + } + + _disposed = true; + } + + public async ValueTask DisposeAsync() + { + if (_disposed) + { + return; + } + + foreach (var socket in _sockets) + { + socket.Closed -= OnConnectionClosed; + await socket.DisposeAsync().ConfigureAwait(false); } _disposed = true; |
