aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Session/SessionManager.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-05-28 11:51:42 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-05-28 11:51:42 -0400
commitcb7fb3ae5c786e8f49e99df592fa63c7ac2af862 (patch)
treeb48c66041b695962fbfbcd2313fbec4a48f64e4c /MediaBrowser.Server.Implementations/Session/SessionManager.cs
parent29ba865ab8f42567f011d593aa0d45ace4431fb9 (diff)
added periodic ping to http session controller
Diffstat (limited to 'MediaBrowser.Server.Implementations/Session/SessionManager.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Session/SessionManager.cs20
1 files changed, 9 insertions, 11 deletions
diff --git a/MediaBrowser.Server.Implementations/Session/SessionManager.cs b/MediaBrowser.Server.Implementations/Session/SessionManager.cs
index d78fae87b..0ee9e6213 100644
--- a/MediaBrowser.Server.Implementations/Session/SessionManager.cs
+++ b/MediaBrowser.Server.Implementations/Session/SessionManager.cs
@@ -248,7 +248,7 @@ namespace MediaBrowser.Server.Implementations.Session
return session;
}
- public async Task ReportSessionEnded(string sessionId)
+ public async void ReportSessionEnded(string sessionId)
{
await _sessionLock.WaitAsync(CancellationToken.None).ConfigureAwait(false);
@@ -256,18 +256,16 @@ namespace MediaBrowser.Server.Implementations.Session
{
var session = GetSession(sessionId);
- if (session == null)
+ if (session != null)
{
- throw new ArgumentException("Session not found");
- }
-
- var key = GetSessionKey(session.Client, session.ApplicationVersion, session.DeviceId);
+ var key = GetSessionKey(session.Client, session.ApplicationVersion, session.DeviceId);
- SessionInfo removed;
+ SessionInfo removed;
- if (_activeConnections.TryRemove(key, out removed))
- {
- OnSessionEnded(removed);
+ if (_activeConnections.TryRemove(key, out removed))
+ {
+ OnSessionEnded(removed);
+ }
}
}
finally
@@ -1155,7 +1153,7 @@ namespace MediaBrowser.Server.Implementations.Session
if (controller == null)
{
- session.SessionController = new HttpSessionController(_httpClient, _jsonSerializer, session, postUrl);
+ session.SessionController = new HttpSessionController(_httpClient, _jsonSerializer, session, postUrl, this);
}
}