VPN

The VPN module offers several methods for retrieving available server locations and their corresponding endpoint configurations.

A server location generally represents a cluster of multiple physical servers, such as New-York-1, which are typically hosted within the same data center. An endpoint refers to a concrete endpoint on those servers, defined by a specific VPN protocol configuration. For example, the New-York-1 location may expose multiple endpoints, such as Lightway UDP, Lightway TCP, or WireGuard, each representing a different protocol option available within that cluster. An alias for endpoints is "instances".

Multi-Threading

While the SDK is safe to be used in a multi-thread environment, some of the features would interfere with each other, when executed simultaneosly. As an example is running a speedtest or pinging locations, while a smart location measurement takes place. The 2 threads would consume bandwidth and the results would not be accurate. The SDK prevents that the following methods can be run simultanously and you can use the module's method get_run_status() to determine, if a measurement takes place:

get_run_status()

Returns the type of measurement currently taking place or None (Nil), if no measurement takes place.

Returns

None/Nil : No measurement is currently running

SmartLocation: A SmartLocation measurement takes place

Speedtest: A Speedtest measurement takes place

cancel_ongoing_operation()

In case a measurement is running, it allows to cancel the operation. This will result in the current operation to fail with an exception OperationRunnerProcessAborted

Last updated