Skip to content

TryGetSnapshot Method ​

Definition ​

  • Namespace: JASE.Network
  • Assembly: JASE.Network.dll

Overloads ​

NameDescription
bool TryGetSnapshot(string keyOrUri, out PooledClientSnapshot output)Attempts to retrieve a point-in-time telemetry snapshot for a pooled HTTP client identified by either a normalized host key or an absolute URI string.
bool TryGetSnapshot(Uri uri, out PooledClientSnapshot output)Attempts to retrieve a point-in-time telemetry snapshot for a pooled HTTP client identified by an absolute Uri.

bool TryGetSnapshot(string keyOrUri, out PooledClientSnapshot output) ​

csharp
bool TryGetSnapshot(string keyOrUri, out PooledClientSnapshot output)

Attempts to retrieve a point-in-time telemetry snapshot for a pooled HTTP client identified by either a normalized host key or an absolute URI string.

Parameters ​

NameDescription
keyOrUriEither a normalized host key in the form "idn-host:port" (e.g., "api.example.com:443") or an absolute URI (e.g., "https://api.example.com/v1/ping").
outputWhen this method returns true, contains the PooledClientSnapshot for the corresponding pooled client; otherwise null.

Returns ​

true if a pooled client was found and a snapshot was retrieved; otherwise false.

Remarks ​

This method is thread-safe. Providing a URI will be normalized to the internal pool key via host (IDN-lowered) and port (default 443 for HTTPS, 80 for HTTP). If no matching pooled client exists, the method returns false without side effects.

bool TryGetSnapshot(Uri uri, out PooledClientSnapshot output) ​

csharp
bool TryGetSnapshot(Uri uri, out PooledClientSnapshot output)

Attempts to retrieve a point-in-time telemetry snapshot for a pooled HTTP client identified by an absolute Uri.

Parameters ​

NameDescription
outputWhen this method returns true, contains the PooledClientSnapshot for the corresponding pooled client; otherwise null.
uriAn absolute URI; its host and effective port are normalized to the internal pool key.

Returns ​

true if a pooled client was found and a snapshot was retrieved; otherwise false.

Remarks ​

The normalization uses IdnHost (lower-cased) and resolves default ports (443 for HTTPS, 80 for HTTP) when IsDefaultPort is true.