Change default transport name to align with spec (#315)
authorJohn Salem <josalem@microsoft.com>
Wed, 19 Jun 2019 17:31:05 +0000 (10:31 -0700)
committerTom McDonald <tommcdon@microsoft.com>
Wed, 19 Jun 2019 17:31:05 +0000 (10:31 -0700)
resolves dotnet/coreclr#24859

src/Microsoft.Diagnostics.Tools.RuntimeClient/DiagnosticsIpc/IpcClient.cs
src/Microsoft.Diagnostics.Tools.RuntimeClient/Eventing/EventPipeClient.cs

index edbf6cc48bd1c45ea07ca7053686c6104a7ebb0f..4958b29793f0ea704220d615ea4e2351ae7a3f1f 100644 (file)
@@ -13,7 +13,7 @@ namespace Microsoft.Diagnostics.Tools.RuntimeClient.DiagnosticsIpc
 {
     public class IpcClient
     {
-        private static string DiagnosticPortPattern { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? @"^dotnetcore-diagnostic-(\d+)$" : @"^dotnetcore-diagnostic-(\d+)-(\d+)-socket$";
+        private static string DiagnosticPortPattern { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? @"^dotnet-diagnostic-(\d+)$" : @"^dotnet-diagnostic-(\d+)-(\d+)-socket$";
 
         private static string IpcRootPath { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? @"\\.\pipe\" : Path.GetTempPath();
 
@@ -28,7 +28,7 @@ namespace Microsoft.Diagnostics.Tools.RuntimeClient.DiagnosticsIpc
         {
             if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
             {
-                string pipeName = $"dotnetcore-diagnostic-{processId}";
+                string pipeName = $"dotnet-diagnostic-{processId}";
                 var namedPipe = new NamedPipeClientStream(
                     ".", pipeName, PipeDirection.InOut, PipeOptions.None, TokenImpersonationLevel.Impersonation);
                 namedPipe.Connect((int)ConnectTimeoutMilliseconds);
@@ -38,7 +38,7 @@ namespace Microsoft.Diagnostics.Tools.RuntimeClient.DiagnosticsIpc
             {
                 string ipcPort = Directory.GetFiles(IpcRootPath) // Try best match.
                     .Select(namedPipe => (new FileInfo(namedPipe)).Name)
-                    .SingleOrDefault(input => Regex.IsMatch(input, $"^dotnetcore-diagnostic-{processId}-(\\d+)-socket$"));
+                    .SingleOrDefault(input => Regex.IsMatch(input, $"^dotnet-diagnostic-{processId}-(\\d+)-socket$"));
                 if (ipcPort == null)
                 {
                     throw new PlatformNotSupportedException($"Process {processId} not running compatible .NET Core runtime");
index 13ff42ff093ccfbde655cf4fc44acbd9dd94af99..825e36746d085253a87a040e9ace102f66c31d17 100644 (file)
@@ -19,7 +19,7 @@ namespace Microsoft.Diagnostics.Tools.RuntimeClient
 {
     public static class EventPipeClient
     {
-        private static string DiagnosticPortPattern { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? @"^dotnetcore-diagnostic-(\d+)$" : @"^dotnetcore-diagnostic-(\d+)-(\d+)-socket$";
+        private static string DiagnosticPortPattern { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? @"^dotnet-diagnostic-(\d+)$" : @"^dotnet-diagnostic-(\d+)-(\d+)-socket$";
 
         private static string IpcRootPath { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? @"\\.\pipe\" : Path.GetTempPath();