Smart Locations
Smart Locations are designed to identify the fastest servers tailored for individual customers. The definition of "fast" encompasses a variety of factors, which are detailed in the implementation of the Smart Location Algorithm.

Caching for Smart Locations
The SDK will internally cache smart locations for 30 days. It will internally use
Country
Region
ISP Name
Autonomous System Number (ASN)
WiFi SSID or Network Name
WiFi BSSID or Network Name
It will therefore rely on the get_user_location() method, to obtain the user's current network parameters. As these network parameters cached as well, it's important to tell the SDK, of the user's network change by calling the SDK Manager networkChanged() method.
However, the SDK can't obtain the WiFi SSID or BSSID, so it's important that apps keep this values up to date when switching between networks, by updating the SDK Managers configuration object:
In a Non-WiFi environment, the network name could the Windows Network Profile Name and the network id could be the mac address of the router. These parameters are optional and just help to further segment the cache results.
Matching cached records
The internal Network Cache Manager uses a multi-step logic to match a cached result with the current network of the user.
Try to match Country, Region, ISP, ASN, SSID, BSSID if no results returned continue with 2.
Try to match Country, Region, ISP, ASN, SSID, if no results returned continue with 3.
Try to match Country, Region, ISP, if no results returned continue with 4.
Try to match Country, Region, if not results returned continue with 5.
Try to match Country, if no results returned RETURN NO ENTRY else continue with 6.
If results are returned, use the most recent result, determined by the date and time they’ve been added
get_smart_locations
get_smart_locationsThis method will return the fasted locations for the user's current network parameters from all available locations contained in his subscription.
If the user is currently connected to the VPN, a Smart Location measurement cannot be performed. In this case, the method will fail if no cached Smart Location is available or if a refresh is explicitly requested.
You can't run this method multiple times simultaneously as the measurements would interfer with each other. The SDK will prevent that multiple instances are running and will return an exception.
Parameters
subscription_id
String
ID of the subscription which has a VPN entitlement. You can obtain that subscription id as described in Obtaining a VPN Subscription ID
refresh
Bool
If false, Smart Locations will be returned from the cache if available. If no cached Smart Location will be found, a new measurement will be performed. If true, the cache will be ignored and a new measurement will be made. This is usually used, if the user "pulls to refresh" in the server list. This will also automatically refresh the user's current network parameters.
Returns
LocationRatingResult upon success or InstanceDiscoveryException otherwise.
LocationRatingResult
Internally, the final rating of a location will be calculated from 4 different measurements:
Physical Distance
Ping Measurement (Latency, Jitter, Packet Loss)
HTTP Up- and Download Measurements (Bandwidth)
location_id
String
Unique ID of the location
distance_rating
DistanceRating (optional)
This contains details about the physical distance between user location and server location
ping_rating
PingRating (optional)
This contains details about the ping measurements like latency, jitter and packet loss.
final_rating_category
RatingCategory
This is the final rating, based on the above weighted ratings.
Last updated