Click or drag to resize

RestClientExtensionsTryPing Method

Attempts to send an HTTP PING to the rest client service. If successful, the reported time drift and latency are returned.

Namespace: SanteDB.Core.Http
Assembly: SanteDB.Core.Api (in SanteDB.Core.Api.dll) Version: 3.0.2081-alpha+b4ae72647f2cc271f89142f76fff26ad69e00f5a
Syntax
public static bool TryPing(
	this IRestClient restClient,
	out long latencyMs,
	out TimeSpan timeDrift
)

Parameters

restClient  IRestClient
The rest client to use to send the PING request.
latencyMs  Int64
When successful, contains the latency in whole milliseconds that the request took. If the function fails, the result will be -1.
timeDrift  TimeSpan
When successful, contains the reported time difference between the client and server. No processing takes place to increase the accuracy of this value. If the request fails, the result will be -1.

Return Value

Boolean
True when the PING request succeeds, false otherwise.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IRestClient. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
ExceptionCondition
ArgumentNullExceptionrestClient is null and the function can not execute.
See Also