2

I need to determine user's bandwidth.I want to force user to read from local data if his connection is bad although he will download it. I am doing this in Objective-C but if there a solution on Swift, It is okay.

Is there any library or any thing else to determine user bandwidth?

Niib Fouda
  • 1,383
  • 1
  • 16
  • 21
  • I don't know Objective C, but one way to determine the bandwith is to download a 50kb or 100kb file (e.g. image) from a website you trust and see how long it takes to download the file. – N.P. Jun 12 '17 at 08:31
  • thanks @N.P. it is a good trick. but I will use it in the whole project that's why I need an efficient solution – Niib Fouda Jun 12 '17 at 08:36

1 Answers1

3

there is no any library for determine bandwidth in objective c. you can check bandwidth by downloading any small size file or open web page. count time duration of file downloading. then count

speed = size/time.

and delete that file. you should use delegate methods.

Sangram Shivankar
  • 3,535
  • 3
  • 26
  • 38
  • 1
    i am also searching the best way for this task. but still not found other solution – Sangram Shivankar Jun 12 '17 at 14:45
  • you can use EBPing (https://github.com/lmirosevic/GBPing) in order to measure the time needed open a web page. – Niib Fouda Jun 20 '17 at 07:41
  • Hello i am using GBPing its send log ENT> host: google.com, seq: 5, status: 0, ttl: 49, payloadSize: 56, sendDate: 2017-08-23 09:35:35 +0000, receiveDate: (null), rtt: 0.000000 2017-08-23 15:05:35.093 PingTester[3450:647345] REPLY> host: google.com, seq: 5, status: 1, ttl: 49, payloadSize: 56, sendDate: 2017-08-23 09:35:35 +0000, receiveDate: 2017-08-23 09:35:35 +0000, rtt: 0.045040 what is the ,eaning of this – Akash Raghani Aug 23 '17 at 09:37