Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simulating low bandwidth with TIdHTTP
(12-03-2020, 02:29 AM)rlebeau Wrote:
(12-02-2020, 09:45 PM)Ahmed Sayed Wrote: Is there some event or property on indy clients that can provide with the size bytes X that needs to be transferred during the DNS resolve or TCP connect?

No.  You would have to refer to the underlying DNS and TCP protocol specs to determine that.

For instance, during the connect stage, 3 TCP packets are exchanged (SYN, SYN+ACK, ACK).  Each packet is 20-60 bytes for the IPv4 header (40+ bytes for an IPv6 header), plus 20-60 bytes for the TCP header.  The actual sizes will vary depending on the particular TCP/IP options that are being used by the OS's socket stack and the application.

During the resolve stage, DNS also involves variable-length packets, which can be carried over UDP or TCP.  So, you have the IPv4/IPv6 header, plus 8 bytes for the UDP header or 20-60 bytes for the TCP header, plus the actual DNS request/response data.  And it may take multiple queries to adequately resolve a hostname to a viable IP address.  I won't go into those details.

Use a packet sniffer, like Wireshark, to see these packets in action.  You will then see exactly how large they really are, on your machine anyway.  You can then approximate the sizes in your calculations.

Thanks, a lot I will try that.  Wink

Forum Jump:

Users browsing this thread: 1 Guest(s)