diff options
| author | Claus Vium <clausvium@gmail.com> | 2019-02-27 23:22:55 +0100 |
|---|---|---|
| committer | Claus Vium <clausvium@gmail.com> | 2019-02-27 23:22:55 +0100 |
| commit | fb1de5a9213f7da98ed15a6975201d6bca3537d4 (patch) | |
| tree | 74ca93c5b068e148cfa67ad013d9db650b2ebb0d /Emby.Server.Implementations/WebSockets/WebSocketManager.cs | |
| parent | 71ed8409446774c395b339728e2436c3b30536d8 (diff) | |
Remove more cruft and add the beginnings of a socket middleware
Diffstat (limited to 'Emby.Server.Implementations/WebSockets/WebSocketManager.cs')
| -rw-r--r-- | Emby.Server.Implementations/WebSockets/WebSocketManager.cs | 22 |
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); + } + } +} |
