ServerProbeTask runs RunServerProbe on a worker thread. It normalises the input URL, calls GTV_PingServer(), and writes a simple result object. The task completes immediately — it does not loop.
XML component definition
ServerProbeTask.xml
Input fields
The server URL to probe (e.g.
"http://192.168.1.50:3333" or "https://admin.globaltv.lat"). The value is normalised by GTV_ServerNormalizeBaseUrl() before use. If empty after normalisation, the task sets done = true immediately without making a network request.Output fields
Populated when
done becomes true. See the Result object section.Set to
true once the probe finishes (success or failure).Result object
| Key | Type | Description |
|---|---|---|
success | Boolean | true if GTV_PingServer() reached the server within TIMEOUT_HEALTH |
baseUrl | String | The normalised URL that was probed |
message | String | Human-readable outcome, e.g. "Conexion correcta con http://…" or "No se pudo conectar con http://…" |
Function flow
Normalise URL
Calls
GTV_ServerNormalizeBaseUrl(m.top.baseUrl). If the result is empty, sets done = true with success = false and returns.Ping server
Calls
GTV_PingServer(baseUrl), which sends a request to baseUrl + PATH_HEALTH with a TIMEOUT_HEALTH (2 500 ms) timeout.AppConstants values used
| Constant | Value | Used for |
|---|---|---|
TIMEOUT_HEALTH | 2500 ms | Ping timeout inside GTV_PingServer() |
PATH_HEALTH | "/health" | Health-check endpoint appended to baseUrl during the ping |
Usage example
The 2 500 ms ping timeout (
TIMEOUT_HEALTH) is intentionally short. This task is designed for interactive use in the settings screen, where a quick response matters more than exhaustive retry logic. Use HandshakeTask or ConnectivityTask for more resilient server discovery.