diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-03-21 12:10:02 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-03-21 12:10:02 -0400 |
| commit | c0aec48a31d96726a6fb1814f28b6971fabca163 (patch) | |
| tree | 5ae0f4c295a722dfbc91e93d20b632d449adcf4e /MediaBrowser.Server.Implementations/Session/WebSocketController.cs | |
| parent | e068e84ab6c2bdee49c41ceef50cbcedd8bcb355 (diff) | |
beta fixes
Diffstat (limited to 'MediaBrowser.Server.Implementations/Session/WebSocketController.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Session/WebSocketController.cs | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/MediaBrowser.Server.Implementations/Session/WebSocketController.cs b/MediaBrowser.Server.Implementations/Session/WebSocketController.cs index f51998fea..d4ecd9572 100644 --- a/MediaBrowser.Server.Implementations/Session/WebSocketController.cs +++ b/MediaBrowser.Server.Implementations/Session/WebSocketController.cs @@ -30,17 +30,28 @@ namespace MediaBrowser.Server.Implementations.Session Sockets = new List<IWebSocketConnection>(); } + private bool HasOpenSockets + { + get { return GetActiveSockets().Any(); } + } + + public bool SupportsMediaControl + { + get { return HasOpenSockets; } + } + + private bool _isActive; public bool IsSessionActive { get { - return Sockets.Any(i => i.State == WebSocketState.Open); + return _isActive; } } - public bool SupportsMediaControl + public void OnActivity() { - get { return GetActiveSockets().Any(); } + _isActive = true; } private IEnumerable<IWebSocketConnection> GetActiveSockets() @@ -64,6 +75,8 @@ namespace MediaBrowser.Server.Implementations.Session { if (!GetActiveSockets().Any()) { + _isActive = false; + try { _sessionManager.ReportSessionEnded(Session.Id); |
