23#include <boost/weak_ptr.hpp>
124 private boost::noncopyable
269 boost::weak_ptr<Peer_socket::Const_ptr::element_type>
m_sock;
Convenience class that simply stores a Logger and/or Component passed into a constructor; and returns...
Interface that the user should implement, passing the implementing Logger into logging classes (Flow'...
A per-Peer_socket module that tries to estimate the bandwidth available to the outgoing flow.
n_bytes_t m_bytes_this_sample
The number of bytes acknowledged by receiver since m_this_sample_start_time (the time when the curren...
n_bytes_t bandwidth_bytes_per_time() const
Returns the current estimate of the available outgoing bandwidth per unit time for the containing soc...
boost::chrono::milliseconds Time_unit
The primary time unit over which this class reports bandwidth.
static n_bytes_t apply_filter(n_bytes_t prev_val_per_time, n_bytes_t new_sample_val_per_time)
Applies the low-pass filter that takes the given previous result of the filter and blends in the give...
boost::weak_ptr< Peer_socket::Const_ptr::element_type > m_sock
The containing socket (read-only access).
uint64_t n_bytes_t
Type that represents the number of bytes, either as an absolute amount or over some time period.
Peer_socket::Const_ptr socket() const
Utility that returns a handle to the containing Peer_socket.
Fine_time_pt m_this_sample_start_time
The time at which the currently ongoing bandwidth sample began to accumulate.
bool m_no_samples_yet
true until a sample has been completed and fed into the filter; false forever thereafter.
Send_bandwidth_estimator(log::Logger *logger_ptr, Peer_socket::Const_ptr sock)
Constructs object by setting up logging and saving a pointer to the containing Peer_socket.
bool m_no_acks_yet
true until on_acks() called for the first time; false forever thereafter. Used to begin the sample se...
n_bytes_t m_bytes_per_time_less_smoothed
In the same units as m_bytes_per_time_smoothed, the less smoothed bandwidth estimate,...
n_bytes_t m_bytes_per_time_smoothed
The current smoothed bandwidth estimate, to be returned by bandwidth_bytes_per_time(),...
void on_acks(size_t bytes)
Informs the bandwidth estimator strategy that 1 or more previously sent packets whose status was In-f...
Const_target_ptr Const_ptr
Short-hand for ref-counted pointer to immutable values of type Target_type::element_type (a-la T cons...
Flow module containing the API and implementation of the Flow network protocol, a TCP-inspired stream...
Fine_clock::time_point Fine_time_pt
A high-res time point as returned by Fine_clock::now() and suitable for precise time math in general.