diff --git a/Core/HA4IoT.Networking/Http/Controllers/HttpRequestController.cs b/Core/HA4IoT.Networking/Http/Controllers/HttpRequestController.cs index 159c1ac0..59230932 100644 --- a/Core/HA4IoT.Networking/Http/Controllers/HttpRequestController.cs +++ b/Core/HA4IoT.Networking/Http/Controllers/HttpRequestController.cs @@ -15,7 +15,7 @@ public HttpRequestController(string name, HttpServer server) if (server == null) throw new ArgumentNullException(nameof(server)); _baseUri = name; - server.RequestReceived += ExecuteActions; + server.HttpRequestReceived += ExecuteActions; } public HttpRequestControllerAction Handle(HttpMethod method, string uri) diff --git a/Core/HA4IoT.Networking/Http/HttpServer.cs b/Core/HA4IoT.Networking/Http/HttpServer.cs index 2e72bc6f..4113d114 100644 --- a/Core/HA4IoT.Networking/Http/HttpServer.cs +++ b/Core/HA4IoT.Networking/Http/HttpServer.cs @@ -31,7 +31,7 @@ public void Bind(int port) _log.Info($"Binded HTTP server to port {port}"); } - public event EventHandler RequestReceived; + public event EventHandler HttpRequestReceived; public event EventHandler WebSocketConnected; public void Dispose() @@ -42,11 +42,7 @@ public void Dispose() private void HandleConnection(StreamSocketListener sender, StreamSocketListenerConnectionReceivedEventArgs args) { - Task.Factory.StartNew( - async () => await HandleConnectionAsync(args.Socket), - _cancellationTokenSource.Token, - TaskCreationOptions.LongRunning, - TaskScheduler.Default); + Task.Run(() => HandleConnectionAsync(args.Socket), _cancellationTokenSource.Token); } private async Task HandleConnectionAsync(StreamSocket clientSocket) @@ -85,7 +81,7 @@ private void HandleWebSocketConnected(object sender, WebSocketConnectedEventArgs private void HandleHttpRequest(object sender, HttpRequestReceivedEventArgs eventArgs) { - var handlerCollection = RequestReceived; + var handlerCollection = HttpRequestReceived; if (handlerCollection == null) { return; diff --git a/Core/HA4IoT/Api/LocalHttpServerService.cs b/Core/HA4IoT/Api/LocalHttpServerService.cs index 454a244b..546ece4e 100644 --- a/Core/HA4IoT/Api/LocalHttpServerService.cs +++ b/Core/HA4IoT/Api/LocalHttpServerService.cs @@ -30,7 +30,7 @@ public LocalHttpServerService(IApiDispatcherService apiDispatcherService, HttpSe public override void Startup() { - _httpServer.RequestReceived += DispatchHttpRequest; + _httpServer.HttpRequestReceived += DispatchHttpRequest; _httpServer.WebSocketConnected += AttachWebSocket; _apiDispatcherService.RegisterAdapter(this); diff --git a/Core/HA4IoT/project.json b/Core/HA4IoT/project.json index 20f33c58..053399f9 100644 --- a/Core/HA4IoT/project.json +++ b/Core/HA4IoT/project.json @@ -1,7 +1,7 @@ { "dependencies": { "Microsoft.NETCore.UniversalWindowsPlatform": "5.2.3", - "MQTTnet": "2.1.0.10", + "MQTTnet": "2.1.1", "Newtonsoft.Json": "10.0.2", "SimpleInjector": "4.0.0" }, diff --git a/HA4IoT.sln b/HA4IoT.sln index 423c4b95..71794c5c 100644 --- a/HA4IoT.sln +++ b/HA4IoT.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 +# Visual Studio 15 +VisualStudioVersion = 15.0.26228.12 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Controllers", "Controllers", "{CD5D2CCD-44D0-46E5-BE14-3B377048E0A2}" EndProject @@ -64,6 +64,7 @@ Global {D3634558-2746-441F-BC09-454B1EC7DC1D}.Release|x86 (For local).ActiveCfg = Release|x86 {D3634558-2746-441F-BC09-454B1EC7DC1D}.Release|x86 (For local).Build.0 = Release|x86 {D4E0A3F9-6521-4AEE-815A-E2A60323FB63}.Debug|Any CPU (For Cloud Components).ActiveCfg = Debug|Any CPU + {D4E0A3F9-6521-4AEE-815A-E2A60323FB63}.Debug|Any CPU (For Cloud Components).Build.0 = Debug|Any CPU {D4E0A3F9-6521-4AEE-815A-E2A60323FB63}.Debug|ARM (For Raspberry Pi).ActiveCfg = Debug|ARM {D4E0A3F9-6521-4AEE-815A-E2A60323FB63}.Debug|ARM (For Raspberry Pi).Build.0 = Debug|ARM {D4E0A3F9-6521-4AEE-815A-E2A60323FB63}.Debug|x86 (For local).ActiveCfg = Debug|x86 @@ -116,6 +117,7 @@ Global {F46489CF-4D81-40DD-8EFB-9B4073898A85}.Release|x86 (For local).Build.0 = Release|x86 {F46489CF-4D81-40DD-8EFB-9B4073898A85}.Release|x86 (For local).Deploy.0 = Release|x86 {C034EC4D-46CC-490A-A045-E4D4D1F49C31}.Debug|Any CPU (For Cloud Components).ActiveCfg = Debug|Any CPU + {C034EC4D-46CC-490A-A045-E4D4D1F49C31}.Debug|Any CPU (For Cloud Components).Build.0 = Debug|Any CPU {C034EC4D-46CC-490A-A045-E4D4D1F49C31}.Debug|ARM (For Raspberry Pi).ActiveCfg = Debug|ARM {C034EC4D-46CC-490A-A045-E4D4D1F49C31}.Debug|ARM (For Raspberry Pi).Build.0 = Debug|ARM {C034EC4D-46CC-490A-A045-E4D4D1F49C31}.Debug|x86 (For local).ActiveCfg = Debug|x86 @@ -138,6 +140,7 @@ Global {C4619FEF-F44F-45EE-9473-5C80BC72E866}.Release|x86 (For local).ActiveCfg = Release|Any CPU {C4619FEF-F44F-45EE-9473-5C80BC72E866}.Release|x86 (For local).Build.0 = Release|Any CPU {B10B2E2A-85CD-4289-8649-FC0C1C98921D}.Debug|Any CPU (For Cloud Components).ActiveCfg = Debug|Any CPU + {B10B2E2A-85CD-4289-8649-FC0C1C98921D}.Debug|Any CPU (For Cloud Components).Build.0 = Debug|Any CPU {B10B2E2A-85CD-4289-8649-FC0C1C98921D}.Debug|Any CPU (For Cloud Components).Deploy.0 = Debug|Any CPU {B10B2E2A-85CD-4289-8649-FC0C1C98921D}.Debug|ARM (For Raspberry Pi).ActiveCfg = Debug|ARM {B10B2E2A-85CD-4289-8649-FC0C1C98921D}.Debug|ARM (For Raspberry Pi).Build.0 = Debug|ARM