37 #ifndef INCLUDED_throttle_detail_hpp 38 #define INCLUDED_throttle_detail_hpp 40 #include <boost/circular_buffer.hpp> 58 size_t m_network_add_cost;
59 size_t m_network_minimal_segment;
60 size_t m_network_max_segment;
62 const size_t m_window_size;
66 boost::circular_buffer< packet_info > m_history;
69 bool m_any_packet_yet;
105 virtual void _handle_trafic_exact(
size_t packet_size,
size_t orginal_size);
106 virtual void logger_handle_net(
const std::string &filename,
double time,
size_t size);
virtual size_t get_recommended_size_of_planned_transport_window(double force_window) const
ditto, but for given windows time frame
virtual ~network_throttle()
network_throttle(const std::string &nameshort, const std::string &name, int window_size=-1)
virtual network_speed_kbps get_target_speed()
double network_time_seconds
virtual double get_current_speed() const
virtual void calculate_times(size_t packet_size, calculate_times_struct &cts, bool dbg, double force_window) const
MAIN LOGIC (see base class for info)
virtual size_t get_recommended_size_of_planned_transport() const
what should be the size (bytes) of next data block to be transported
network_throttle m_inreq
for requesting incomming traffic (this is exact usually)
virtual void set_target_speed(network_speed_kbps target)
double network_speed_kbps
network_throttle_bw(const std::string &name1)
interface for throttling of connection (count and rate-limit speed etc)
virtual void get_stats(uint64_t &total_packets, uint64_t &total_bytes) const
virtual void handle_trafic_tcp(size_t packet_size)
count the new traffic/packet; the size is as TCP, we will consider MTU etc
unsigned __int64 uint64_t
virtual void handle_trafic_exact(size_t packet_size)
count the new traffic/packet; the size is exact considering all network costs
network_throttle m_out
for outgoing traffic that we just sent (this is exact usually)
virtual void tick()
poke and update timers/history (recalculates, moves the history if needed, checks the real clock etc)...
virtual network_time_seconds get_sleep_time_after_tick(size_t packet_size)
increase the timer if needed, and get the package size
virtual network_time_seconds get_sleep_time(size_t packet_size) const
gets the Delay (recommended Delay time) from calc. (not safe: only if time didnt change?) TODO
virtual double get_time_seconds() const
timer that we use, time in seconds, monotionic
network_throttle m_in
for incomming traffic (this we can not controll directly as it depends of what others send to us - us...
virtual void set_name(const std::string &name)