36#ifndef INCLUDED_throttle_detail_hpp
37#define INCLUDED_throttle_detail_hpp
39#include <boost/circular_buffer.hpp>
105 virtual void logger_handle_net(
const std::string &filename,
double time,
size_t size);
Definition: network_throttle.hpp:125
Definition: network_throttle-detail.hpp:48
virtual ~network_throttle()
Definition: network_throttle-detail.cpp:117
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?...
Definition: network_throttle-detail.cpp:238
network_time_seconds m_start_time
Definition: network_throttle-detail.hpp:67
virtual network_speed_kbps get_target_speed()
Definition: network_throttle-detail.cpp:153
virtual network_time_seconds time_to_slot(network_time_seconds t) const
Definition: network_throttle-detail.hpp:103
virtual void set_name(const std::string &name)
Definition: network_throttle-detail.cpp:142
network_time_seconds m_last_sample_time
Definition: network_throttle-detail.hpp:66
virtual double get_time_seconds() const
timer that we use, time in seconds, monotionic
Definition: network_throttle-detail.cpp:310
bool m_any_packet_yet
Definition: network_throttle-detail.hpp:68
virtual void tick()
poke and update timers/history (recalculates, moves the history if needed, checks the real clock etc)
Definition: network_throttle-detail.cpp:158
std::string m_name
Definition: network_throttle-detail.hpp:72
uint64_t m_total_bytes
Definition: network_throttle-detail.hpp:70
virtual void handle_trafic_tcp(size_t packet_size)
count the new traffic/packet; the size is as TCP, we will consider MTU etc
Definition: network_throttle-detail.cpp:210
boost::circular_buffer< packet_info > m_history
Definition: network_throttle-detail.hpp:65
network_time_seconds m_slot_size
Definition: network_throttle-detail.hpp:62
virtual network_time_seconds get_sleep_time_after_tick(size_t packet_size)
increase the timer if needed, and get the package size
Definition: network_throttle-detail.cpp:217
network_speed_bps m_target_speed
Definition: network_throttle-detail.hpp:56
virtual double get_current_speed() const
Definition: network_throttle-detail.cpp:343
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)
Definition: network_throttle-detail.cpp:247
const size_t m_window_size
Definition: network_throttle-detail.hpp:61
virtual void set_target_speed(network_speed_kbps target)
Definition: network_throttle-detail.cpp:147
virtual void logger_handle_net(const std::string &filename, double time, size_t size)
Definition: network_throttle-detail.cpp:222
size_t m_network_max_segment
Definition: network_throttle-detail.hpp:59
uint64_t m_total_packets
Definition: network_throttle-detail.hpp:69
virtual size_t get_recommended_size_of_planned_transport_window(double force_window) const
ditto, but for given windows time frame
Definition: network_throttle-detail.cpp:322
virtual void _handle_trafic_exact(size_t packet_size, size_t orginal_size)
Definition: network_throttle-detail.cpp:189
std::string m_nameshort
Definition: network_throttle-detail.hpp:73
virtual void get_stats(uint64_t &total_packets, uint64_t &total_bytes) const
Definition: network_throttle-detail.cpp:358
size_t m_network_add_cost
Definition: network_throttle-detail.hpp:57
size_t m_network_minimal_segment
Definition: network_throttle-detail.hpp:58
virtual size_t get_recommended_size_of_planned_transport() const
what should be the size (bytes) of next data block to be transported
Definition: network_throttle-detail.cpp:332
virtual void handle_trafic_exact(size_t packet_size)
count the new traffic/packet; the size is exact considering all network costs
Definition: network_throttle-detail.cpp:184
double network_speed_kbps
Definition: network_throttle.hpp:76
double network_time_seconds
Definition: network_throttle.hpp:78
double network_speed_bps
Definition: network_throttle.hpp:77
TODO: (mj-xmr) This will be reduced in an another PR.
Definition: byte_slice.h:40
interface for throttling of connection (count and rate-limit speed etc)
const char * name
Definition: options.c:30
unsigned __int64 uint64_t
Definition: stdint.h:136
Definition: network_throttle.hpp:86
Definition: network_throttle-detail.hpp:50
packet_info()
Definition: network_throttle-detail.cpp:119
size_t m_size
Definition: network_throttle-detail.hpp:51
Definition: network_throttle-detail.hpp:111
network_throttle m_in
for incomming traffic (this we can not controll directly as it depends of what others send to us - us...
Definition: network_throttle-detail.hpp:113
network_throttle m_out
for outgoing traffic that we just sent (this is exact usually)
Definition: network_throttle-detail.hpp:115
network_throttle m_inreq
for requesting incomming traffic (this is exact usually)
Definition: network_throttle-detail.hpp:114