From ed4f3d940ccac41aacc0ec33a6aa4ad7b0a26a6d Mon Sep 17 00:00:00 2001 From: Mateusz Klatecki <47118568+MateuszKlatecki@users.noreply.github.com> Date: Fri, 24 Apr 2020 10:36:26 +0200 Subject: [PATCH] Fixes in AcceptThread method (#89) --- .../Http/System.Net.HttpListener.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/nanoFramework.System.Net.Http/Http/System.Net.HttpListener.cs b/source/nanoFramework.System.Net.Http/Http/System.Net.HttpListener.cs index 9da40ad0..a8018bb1 100644 --- a/source/nanoFramework.System.Net.Http/Http/System.Net.HttpListener.cs +++ b/source/nanoFramework.System.Net.Http/Http/System.Net.HttpListener.cs @@ -367,7 +367,7 @@ private void AcceptThreadFunc() } catch (SocketException) { - if (retry > 5) + if (++retry > 5) { // If request to stop listener flag is set or locking call is interupted return // On exception we stop the service and record the exception. @@ -420,7 +420,7 @@ private void AcceptThreadFunc() netStream.ReadTimeout = 10000; } } - catch(SocketException) + catch { if (netStream != null) {