Add some websocket manager boilerplate

This commit is contained in:
Claus Vium
2019-03-01 14:08:51 +01:00
parent 1ac282b12e
commit 6bdb5debd2
3 changed files with 98 additions and 7 deletions

View File

@@ -25,7 +25,10 @@ namespace Emby.Server.Implementations.Middleware
if (httpContext.WebSockets.IsWebSocketRequest)
{
var webSocketContext = await httpContext.WebSockets.AcceptWebSocketAsync(null).ConfigureAwait(false);
_webSocketManager.AddSocket(webSocketContext);
if (webSocketContext != null)
{
await _webSocketManager.OnWebSocketConnected(webSocketContext);
}
}
else
{