From a1b45e98904c287b82d2f7d24eb4f4e2a248e211 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 11 May 2013 12:41:50 -0400 Subject: fixed web socket check-ins --- MediaBrowser.Controller/Session/SessionInfo.cs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'MediaBrowser.Controller/Session/SessionInfo.cs') diff --git a/MediaBrowser.Controller/Session/SessionInfo.cs b/MediaBrowser.Controller/Session/SessionInfo.cs index 93ef4f694..c9ed47756 100644 --- a/MediaBrowser.Controller/Session/SessionInfo.cs +++ b/MediaBrowser.Controller/Session/SessionInfo.cs @@ -1,4 +1,6 @@ -using MediaBrowser.Common.Net; +using System.Collections.Generic; +using System.Linq; +using MediaBrowser.Common.Net; using MediaBrowser.Controller.Entities; using MediaBrowser.Model.Net; using System; @@ -10,6 +12,11 @@ namespace MediaBrowser.Controller.Session /// public class SessionInfo { + public SessionInfo() + { + WebSockets = new List(); + } + /// /// Gets or sets the id. /// @@ -86,7 +93,7 @@ namespace MediaBrowser.Controller.Session /// Gets or sets the web socket. /// /// The web socket. - public IWebSocketConnection WebSocket { get; set; } + public List WebSockets { get; set; } /// /// Gets a value indicating whether this instance is active. @@ -96,9 +103,9 @@ namespace MediaBrowser.Controller.Session { get { - if (WebSocket != null) + if (WebSockets.Count > 0) { - return WebSocket.State == WebSocketState.Open; + return WebSockets.Any(i => i.State == WebSocketState.Open); } return (DateTime.UtcNow - LastActivityDate).TotalMinutes <= 5; @@ -113,7 +120,7 @@ namespace MediaBrowser.Controller.Session { get { - return WebSocket != null && WebSocket.State == WebSocketState.Open; + return WebSockets.Any(i => i.State == WebSocketState.Open); } } } -- cgit v1.2.3