28#include <boost/weak_ptr.hpp>
179 private boost::noncopyable
252 virtual void on_acks(
size_t bytes,
size_t packets);
433 boost::weak_ptr<Peer_socket::Const_ptr::element_type>
m_sock;
447 private boost::noncopyable
481 static void get_ids(std::vector<std::string>* ids);
487 friend std::istream&
operator>>(std::istream& is,
490 friend std::ostream&
operator<<(std::ostream& os,
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'...
Namespace-like class that enables an enum-based selection of the Congestion_control_strategy interfac...
friend std::ostream & operator<<(std::ostream &os, const Congestion_control_selector::Strategy_choice &strategy_choice)
Serializes a Peer_socket_options::Congestion_control_strategy_choice enum to a standard ostream – the...
Congestion_control_selector()=delete
Forbid all instantiation.
static Congestion_control_strategy * create_strategy(Strategy_choice strategy_choice, log::Logger *logger_ptr, Peer_socket::Const_ptr sock)
Factory method that, given an enum identifying the desired strategy, allocates the appropriate Conges...
static const std::map< Strategy_choice, std::string > S_STRATEGY_TO_ID_MAP
The inverse of S_ID_TO_STRATEGY_MAP.
friend std::istream & operator>>(std::istream &is, Congestion_control_selector::Strategy_choice &strategy_choice)
Deserializes a Peer_socket_options::Congestion_control_strategy_choice enum from a standard input str...
static const std::map< std::string, Strategy_choice > S_ID_TO_STRATEGY_MAP
Maps each ID to the corresponding Strategy_choice enum value.
static void get_ids(std::vector< std::string > *ids)
Returns a list of strings, called IDs, each of which textually represents a distinct Congestion_contr...
The abstract interface for a per-socket module that determines the socket's congestion control behavi...
Congestion_control_strategy(log::Logger *logger_ptr, Peer_socket::Const_ptr sock)
Constructs object by setting up logging and saving a pointer to the containing Peer_socket.
boost::weak_ptr< Peer_socket::Const_ptr::element_type > m_sock
The containing socket (read-only access).
virtual void on_loss_event(size_t bytes, size_t packets)
Informs the congestion control strategy that 1 or more previously sent packets whose status was In-fl...
virtual size_t congestion_window_bytes() const =0
Returns the maximal number of bytes (with respect to m_data field of DATA packets) that this socket s...
Peer_socket::Const_ptr socket() const
Utility for subclasses that returns a handle to the containing Peer_socket.
virtual void on_idle_timeout()
Informs the congestion control strategy that Node considers the connection to be "idle" by virtue of ...
virtual void on_acks(size_t bytes, size_t packets)
Informs the congestion control strategy that 1 or more previously sent packets whose status was In-fl...
virtual void on_individual_ack(const Fine_duration &packet_rtt, const size_t bytes, const size_t sent_cwnd_bytes)
Informs the congestion control strategy that exactly 1 previously sent packet whose status was In-fli...
virtual void on_drop_timeout(size_t bytes, size_t packets)
Informs the congestion control strategy that 1 or more previously sent packets whose status was In-fl...
An empty interface, consisting of nothing but a default virtual destructor, intended as a boiler-plat...
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::duration Fine_duration
A high-res time duration as computed from two Fine_time_pts.
Congestion_control_strategy_choice
The possible choices for congestion control strategy for the socket.