How to detect Network Signal Strength in iOS Reachability

My original thought was to time the download of a file, and see how long it takes: @interface ViewController () <NSURLSessionDelegate, NSURLSessionDataDelegate> @property (nonatomic) CFAbsoluteTime startTime; @property (nonatomic) CFAbsoluteTime stopTime; @property (nonatomic) long long bytesReceived; @property (nonatomic, copy) void (^speedTestCompletionHandler)(CGFloat megabytesPerSecond, NSError *error); @end @implementation ViewController – (void)viewDidLoad { [super viewDidLoad]; [self testDownloadSpeedWithTimout:5.0 completionHandler:^(CGFloat megabytesPerSecond, … Read more

Bandwidth throttling in C#

Based on @0xDEADBEEF’s solution I created the following (testable) solution based on Rx schedulers: public class ThrottledStream : Stream { private readonly Stream parent; private readonly int maxBytesPerSecond; private readonly IScheduler scheduler; private readonly IStopwatch stopwatch; private long processed; public ThrottledStream(Stream parent, int maxBytesPerSecond, IScheduler scheduler) { this.maxBytesPerSecond = maxBytesPerSecond; this.parent = parent; this.scheduler = … Read more

Detecting network connection speed and bandwidth usage in C#

Try using the System.Net.NetworkInformation classes. In particular, System.Net.NetworkInformation.IPv4InterfaceStatistics ought to have some information along the lines of what you’re looking for. Specifically, you can check the bytesReceived property, wait a given interval, and then check the bytesReceived property again to get an idea of how many bytes/second your connection is processing. To get a good … Read more