Skip to content

Commit f3a1a39

Browse files
committed
[DiagnosticsClient] Add DiagnosticsClientConnector APIs
1 parent e4a18ae commit f3a1a39

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

docs/core/diagnostics/microsoft-diagnostics-netcore-client.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,36 @@ public void Dispose();
489489

490490
Releases resources associated with the `EventPipeSession`.
491491

492+
## DiagnosticsClientConnector class
493+
494+
```csharp
495+
public sealed class DiagnosticsClientConnector : IAsyncDisposable
496+
{
497+
public DiagnosticsClient Instance { get; }
498+
499+
public ValueTask DisposeAsync();
500+
501+
public static Task<DiagnosticsClientConnector> FromDiagnosticPort(
502+
string diagnosticPort,
503+
CancellationToken ct);
504+
}
505+
```
506+
507+
Represents a helper that creates a `DiagnosticsClient` from a diagnostic port and manages the lifetime of the underlying diagnostics server connection.
508+
509+
* `Instance` : The `DiagnosticsClient` connected to the target runtime.
510+
* `DisposeAsync` : Disposes the underlying server/connection asynchronously.
511+
* `FromDiagnosticPort` : Creates a new `DiagnosticsClientConnector` from the specified diagnostic port.
512+
513+
```csharp
514+
public static Task<DiagnosticsClientConnector> FromDiagnosticPort(
515+
string diagnosticPort,
516+
CancellationToken ct)
517+
```
518+
519+
* `diagnosticPort` : The diagnostic port string (for example, a listen or connect port) to connect through.
520+
* `ct` : The token to monitor for cancellation requests.
521+
492522
## DumpType enum
493523

494524
```csharp

0 commit comments

Comments
 (0)