mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-11-16 10:29:01 -07:00
23 lines
560 B
C#
23 lines
560 B
C#
|
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);
|
||
|
}
|
||
|
}
|
||
|
}
|