From: mikelle-rogers <45022607+mikelle-rogers@users.noreply.github.com> Date: Wed, 8 Sep 2021 20:52:30 +0000 (-0600) Subject: In dotnet-trace/counters disposed of the server when we received ctrl+C while waiting... X-Git-Tag: submit/tizen/20220302.040122~21^2^2~101 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=efc8030c74f1bdf5b05702ad8bbdaec5e3c1b250;p=platform%2Fcore%2Fdotnet%2Fdiagnostics.git In dotnet-trace/counters disposed of the server when we received ctrl+C while waiting for clients to connect. closes #2426 (#2476) * Disposed of the server when we received ctrl+C while waiting for clients to connect * removed deletion of files to alow the server to clean things up --- diff --git a/src/Tools/Common/ReversedServerHelpers/ReversedServerHelpers.cs b/src/Tools/Common/ReversedServerHelpers/ReversedServerHelpers.cs index 506c7ccca..1b6d99695 100644 --- a/src/Tools/Common/ReversedServerHelpers/ReversedServerHelpers.cs +++ b/src/Tools/Common/ReversedServerHelpers/ReversedServerHelpers.cs @@ -162,10 +162,6 @@ namespace Microsoft.Internal.Common.Utils public async void Dispose() { - if (!string.IsNullOrEmpty(_port) && File.Exists(_port)) - { - File.Delete(_port); - } ProcessLauncher.Launcher.Cleanup(); if (_server != null) { @@ -256,6 +252,8 @@ namespace Microsoft.Internal.Common.Utils } catch (TaskCanceledException) { + //clean up the server + await server.DisposeAsync(); if (!ct.IsCancellationRequested) { throw;