Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simulating low bandwidth with TIdHTTP
#8
(12-02-2020, 04:10 PM)Ahmed Sayed Wrote: But what I meant is that, I have an internet speed of 30MB my transfer speed when I download anything is between 2.5 and 3.5 MB. I know Egypt still does not have fast internet connections, so, let's say that I want to mimic a speed of 512 kbps instead of 3.5 MB I believe if I used your example I should get an exact result on how much should I delay the request on the resolve DNS state or connect. Will that work and simulate the speed that I want?

If you want to be technical about it - DNS requests and TCP handshakes exchange multiple IP packets back and forth. Those packets take up X bytes to transmit. So, if you want to simulate a 512kbps connection during the DNS resolve and TCP connect stages, then convert X to bits, multiply by 1000, and divide by 512kb, and that will be how many milliseconds minimum you need to sleep. It is just basic math.

Reply


Messages In This Thread
RE: Simulating low bandwidth with TIdHTTP - by rlebeau - 12-02-2020, 07:23 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)