Photon Unity Networking 2 2.30

Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
RegionPinger Class Reference

Public Member Functions

 RegionPinger (Region region, Action< Region > onDoneCallback)
 
bool Start ()
 Starts the ping routine for the assigned region. More...
 
string GetResults ()
 

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
 

Static Public Attributes

static int Attempts = 5
 
static bool IgnoreInitialAttempt = true
 
static int MaxMilliseconsPerPing = 800
 
static int PingWhenFailed = Attempts * MaxMilliseconsPerPing
 

Properties

bool Done [get]
 

Member Function Documentation

◆ ResolveHost()

static string ResolveHost ( string  hostName)
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...

Parameters
hostNameHostname to resolve.
Returns
IP string or empty string if resolution fails

◆ Start()

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.

Returns
Always true.