aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/WebSockets/WebSocketManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Server.Implementations/WebSockets/WebSocketManager.cs')
-rw-r--r--Emby.Server.Implementations/WebSockets/WebSocketManager.cs22
1 files changed, 22 insertions, 0 deletions
diff --git a/Emby.Server.Implementations/WebSockets/WebSocketManager.cs b/Emby.Server.Implementations/WebSockets/WebSocketManager.cs
new file mode 100644
index 000000000..7e74a4527
--- /dev/null
+++ b/Emby.Server.Implementations/WebSockets/WebSocketManager.cs
@@ -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);
+ }
+ }
+}