aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Session/SessionWebSocketListener.cs
diff options
context:
space:
mode:
authorgion <oancaionutandrei@gmail.com>2020-05-26 11:37:52 +0200
committergion <oancaionutandrei@gmail.com>2020-05-26 11:37:52 +0200
commite42bfc92f3e072a3d51dddce06bc90587e06791c (patch)
treeb436044e5886e310f8f5f1e466af13c042c90fda /Emby.Server.Implementations/Session/SessionWebSocketListener.cs
parente4838b0faa2dafec9382abe8e00bd18be624a030 (diff)
Fix code issues
Diffstat (limited to 'Emby.Server.Implementations/Session/SessionWebSocketListener.cs')
-rw-r--r--Emby.Server.Implementations/Session/SessionWebSocketListener.cs10
1 files changed, 5 insertions, 5 deletions
diff --git a/Emby.Server.Implementations/Session/SessionWebSocketListener.cs b/Emby.Server.Implementations/Session/SessionWebSocketListener.cs
index 3af18f681..e7b4b0ec3 100644
--- a/Emby.Server.Implementations/Session/SessionWebSocketListener.cs
+++ b/Emby.Server.Implementations/Session/SessionWebSocketListener.cs
@@ -87,13 +87,13 @@ namespace Emby.Server.Implementations.Session
httpServer.WebSocketConnected += OnServerManagerWebSocketConnected;
}
- private void OnServerManagerWebSocketConnected(object sender, GenericEventArgs<IWebSocketConnection> e)
+ private async void OnServerManagerWebSocketConnected(object sender, GenericEventArgs<IWebSocketConnection> e)
{
var session = GetSession(e.Argument.QueryString, e.Argument.RemoteEndPoint.ToString());
if (session != null)
{
EnsureController(session, e.Argument);
- KeepAliveWebSocket(e.Argument);
+ await KeepAliveWebSocket(e.Argument);
}
else
{
@@ -149,7 +149,7 @@ namespace Emby.Server.Implementations.Session
/// <param name="e">The event arguments.</param>
private void OnWebSocketClosed(object sender, EventArgs e)
{
- var webSocket = (IWebSocketConnection) sender;
+ var webSocket = (IWebSocketConnection)sender;
_logger.LogDebug("WebSocket {0} is closed.", webSocket);
RemoveWebSocket(webSocket);
}
@@ -158,7 +158,7 @@ namespace Emby.Server.Implementations.Session
/// Adds a WebSocket to the KeepAlive watchlist.
/// </summary>
/// <param name="webSocket">The WebSocket to monitor.</param>
- private void KeepAliveWebSocket(IWebSocketConnection webSocket)
+ private async Task KeepAliveWebSocket(IWebSocketConnection webSocket)
{
lock (_webSocketsLock)
{
@@ -176,7 +176,7 @@ namespace Emby.Server.Implementations.Session
// Notify WebSocket about timeout
try
{
- SendForceKeepAlive(webSocket).Wait();
+ await SendForceKeepAlive(webSocket);
}
catch (WebSocketException exception)
{