search for: sock_kbps_update

Displaying 1 result from an estimated 1 matches for "sock_kbps_update".

2004 Aug 06
3
net/sock.c question
...add bandwidth <limit> option to icecast. My ideea is to compute the current bandwidth by estimation on each sock_write*() call. Something like this: 1. initially we set kbps = 0, kbps_time = now and kbps_bytes = 0 2. after some time, a sock_write*() function is called which in turn calls sock_kbps_update(nobytes); sock_kbps_update fetches current timestamp, adds nobytes to kbps_bytes then: 2.1 if the time difference between now and kbps_time is smaller than ESTIMATION_INTERVAL (which I think a value of 5 seconds should do) then we go back to 2 2.2 if the time difference is greater or equal to ES...