mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-23 09:14:45 +03:00
Remove more cruft and add the beginnings of a socket middleware
This commit is contained in:
22
Emby.Server.Implementations/WebSockets/WebSocketManager.cs
Normal file
22
Emby.Server.Implementations/WebSockets/WebSocketManager.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Net.WebSockets;
|
||||
|
||||
namespace Emby.Server.Implementations.WebSockets
|
||||
{
|
||||
public class WebSocketManager
|
||||
{
|
||||
private readonly ConcurrentDictionary<Guid, WebSocket> _activeWebSockets;
|
||||
|
||||
public WebSocketManager()
|
||||
{
|
||||
_activeWebSockets = new ConcurrentDictionary<Guid, WebSocket>();
|
||||
}
|
||||
|
||||
public void AddSocket(WebSocket webSocket)
|
||||
{
|
||||
var guid = Guid.NewGuid();
|
||||
_activeWebSockets.TryAdd(guid, webSocket);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user