ConnectivityTask runs RunConnectivityTask as a persistent worker thread. It pings the active server every 10 seconds and updates m.global.hasInternet and m.global.isOnline. The task can also be triggered to check immediately via the checkNow input field.
This task runs for the entire lifetime of the channel. Stop it only by setting
control = "stop" when the channel is closing.XML component definition
ConnectivityTask.xml
Input fields
Toggle to
true to trigger an immediate connectivity check outside the normal 10-second cycle. The task resets the field to false after the check completes.Output fields
Updated after every check.
true when GTV_PingServer() succeeds against the active server; false otherwise. The same value is mirrored to m.global.hasInternet.Global state written
In addition to thehasInternet field, the task updates two global fields directly:
| Global field | Description |
|---|---|
m.global.hasInternet | Mirror of the hasInternet output field |
m.global.isOnline | Result of GTV_IsOnline() (roDeviceInfo.GetConnectionType() check) |
Function flow
Initial check
DoCheck() is called once before the wait loop starts so that connectivity state is available immediately.Handle control messages
If
checkNow fires, runs DoCheck() immediately and resets the field. If control = "stop", the task returns.Scheduled check
When the wait times out (no message received),
DoCheck() runs for the scheduled interval tick.DoCheck
Resolves the server URL from
m.global.activeServer via GTV_ServerNormalizeBaseUrl(). Falls back to GTV_ServerPrimaryConnectivityUrl() if no active server is set. Calls GTV_PingServer(server) and writes the boolean result to m.top.hasInternet, m.global.hasInternet, and m.global.isOnline.Usage example
hasInternet reflects reachability to the configured server, not just general internet access. A device may have an active Wi-Fi connection but still return false if the GlobalTV backend is unreachable.