How to check user network speed with iPhone?

Possible duplicate:
Calculation of connection / download speed

I put data on 3 servers to use the application. I want users to download data from the fastest server base in their network connection. Therefore, I need to check the network connection speed of the user to my server. Is there a way to check the speed of the user with the iPhone?

+6
source share
1 answer

Finally, I found a solution and it works great.

I put a small static file, for example https://www.google.com/images/icons/product/chrome-48.png , on each server, then upload the file from each server and calculate the time spent ( Calculation of connection / download speed - nice way to calculate speed thanks to @Antonio MG) and then save the fastest server with NSUserDefaults . Before downloading the application from the server, replace the request url node with the fastest host.

When the application is running or applicationWillEnterForeground: perform a network speed check. Now, every time you download the application, the fastest server that has just been calculated is loaded.

Hope this helps those who need it.

+3
source

Source: https://habr.com/ru/post/914107/


All Articles