Reputation: 725
I am new to network programming and am trying to develop an application for rate controllable file transfer using socket programming in C++ for my networks' course assignment. I would like to know how to control the download rate/upload rate in file transfer. In fact, is there a way to measure the bandwidth of the host? (so that we can know the time for a data sent with the send() to be received).
Upvotes: 2
Views: 1790
Reputation: 49028
The most common method of rate limiting is to use a token bucket. Basically, you increment a counter at the rate you want to send, then when you send the data, you decrement that counter and only send as many bytes as the counter says is available.
Upvotes: 4