Appearance
TryGetSnapshot Method
Definition
- Namespace:
JASE.Network - Assembly:
JASE.Network.dll
Overloads
| Name | Description |
|---|---|
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
| Name | Description |
|---|---|
keyOrUri | Either 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"). |
output | When 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
| Name | Description |
|---|---|
output | When this method returns true, contains the PooledClientSnapshot for the corresponding pooled client; otherwise null. |
uri | An 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.