aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
diff options
context:
space:
mode:
authorAnthony Lavado <anthonylavado@users.noreply.github.com>2019-06-05 01:11:25 -0400
committerGitHub <noreply@github.com>2019-06-05 01:11:25 -0400
commit256f44a87029577ed5daa7646c68e8a395e19708 (patch)
treeaf2f46e34632fe989831f9f5873b6faccf830fc9 /Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
parentf631b2ecdc4554fb723f7e7939a1a6f4e21f4f06 (diff)
parentce1fa42f9d39add8467bfed186730c4a9545344d (diff)
Merge pull request #994 from Bond-009/tasks
Remove Tasks wrapped in a Task
Diffstat (limited to 'Emby.Server.Implementations/HttpServer/HttpListenerHost.cs')
-rw-r--r--Emby.Server.Implementations/HttpServer/HttpListenerHost.cs14
1 files changed, 5 insertions, 9 deletions
diff --git a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
index b3d2b9cc2..d8938964f 100644
--- a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
+++ b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
@@ -805,19 +805,15 @@ namespace Emby.Server.Implementations.HttpServer
Logger.LogDebug("Websocket message received: {0}", result.MessageType);
- var tasks = _webSocketListeners.Select(i => Task.Run(async () =>
+ IEnumerable<Task> GetTasks()
{
- try
- {
- await i.ProcessMessage(result).ConfigureAwait(false);
- }
- catch (Exception ex)
+ foreach (var x in _webSocketListeners)
{
- Logger.LogError(ex, "{0} failed processing WebSocket message {1}", i.GetType().Name, result.MessageType ?? string.Empty);
+ yield return x.ProcessMessageAsync(result);
}
- }));
+ }
- return Task.WhenAll(tasks);
+ return Task.WhenAll(GetTasks());
}
public void Dispose()