Wraps the ping attempts and workflow for a single region. More...
Public Member Functions | |
RegionPinger (Region region, Action< Region > onDoneCallback) | |
Initializes a RegionPinger for the given region. More... | |
bool | Start () |
Starts the ping routine for the assigned region. More... | |
string | GetResults () |
Gets this region's results as string summary. More... | |
Static Public Member Functions | |
static string | ResolveHost (string hostName) |
Attempts to resolve a hostname into an IP string or returns empty string if that fails. More... | |
Public Attributes | |
int | CurrentAttempt = 0 |
Current ping attempt count. More... | |
Static Public Attributes | |
static int | Attempts = 5 |
How often to ping a region. More... | |
static int | MaxMillisecondsPerPing = 800 |
How long to wait maximum for a response. More... | |
static int | PingWhenFailed = Attempts * MaxMillisecondsPerPing |
Ping result when pinging failed. More... | |
Properties | |
bool | Done [get] |
True if all attempts are done or timed out. More... | |
bool | Aborted [get, set] |
Set to true to abort pining this region. More... | |
Wraps the ping attempts and workflow for a single region.
RegionPinger | ( | Region | region, |
Action< Region > | onDoneCallback | ||
) |
Initializes a RegionPinger for the given region.
string GetResults | ( | ) |
Gets this region's results as string summary.
|
static |
Attempts to resolve a hostname into an IP string or returns empty string if that fails.
To be compatible with most platforms, the address family is checked like this:
if (ipAddress.AddressFamily.ToString().Contains("6")) // ipv6...
hostName | Hostname to resolve. |
bool Start | ( | ) |
Starts the ping routine for the assigned region.
Pinging runs in a ThreadPool worker item or (if needed) in a Thread. WebGL runs pinging on the Main Thread as coroutine.
|
static |
How often to ping a region.
int CurrentAttempt = 0 |
Current ping attempt count.
|
static |
How long to wait maximum for a response.
|
static |
Ping result when pinging failed.
|
getset |
Set to true to abort pining this region.
|
get |
True if all attempts are done or timed out.