Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simulating low bandwidth with TIdHTTP
#5
(12-01-2020, 05:52 PM)rlebeau Wrote:
(12-01-2020, 05:08 PM)Ahmed Sayed Wrote: Sorry. What I meant is that the client still connects to host faster than the simulated speed as it is still on the same machine, while connecting to a remote server takes around a second or two.

You can't control the speed in which a TCP connection is established, as that is handled entirely at the OS layer.  The best you could do at the application layer is delay when that connection is attempted, such as by calling Sleep() inside of the OnStatus event during the hsResolving (DNS) and hsConnecting (TCP) states.

Thanks for the reply, Is there like an equation or formula that to calculate how many milliseconds to sleep on those TCP states to mimic a speed of my selection?
Reply


Messages In This Thread
RE: Simulating low bandwidth with TIdHTTP - by Ahmed Sayed - 12-02-2020, 12:32 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)