Fix web sockets closing ungracefully

This commit is contained in:
luke brown
2022-05-09 20:21:13 -05:00
parent 39196bb5e2
commit 4b563f4d7e
6 changed files with 55 additions and 0 deletions

View File

@@ -231,6 +231,15 @@ namespace Emby.Server.Implementations.HttpServer
CancellationToken.None);
}
/// <summary>
/// Gracefully closes the socket.
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
public void CloseSocket(CancellationToken cancellationToken)
{
_socket.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, "System Shutdown", cancellationToken);
}
/// <inheritdoc />
public void Dispose()
{