28#include <boost/unordered_set.hpp>
29#include <boost/enable_shared_from_this.hpp>
123 public boost::enable_shared_from_this<Server_socket>,
125 private boost::noncopyable
246 template<
typename Rep,
typename Period>
248 bool reactor_pattern =
false,
433template<
typename Rep,
typename Period>
437 assert(max_wait.count() > 0);
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'...
An object of this class is a single Flow-protocol networking node, in the sense that: (1) it has a di...
A server socket able to listen on a single Flow port for incoming connections and return peer sockets...
Peer_socket_ptr sync_accept(const boost::chrono::duration< Rep, Period > &max_wait, bool reactor_pattern=false, Error_code *err_code=0)
Blocking (synchronous) version of accept().
util::Mutex_recursive Mutex
Short-hand for reentrant mutex type.
boost::unordered_set< Peer_socket_ptr > m_connecting_socks
Set of passively opening sockets in pre-ESTABLISHED (so SYN_RCVD?) internal state (and thus are not y...
Server_socket(log::Logger *logger, const Peer_socket_options *child_sock_opts)
Constructs object; initializes most values to well-defined (0, empty, etc.) but not necessarily meani...
boost::shared_ptr< Peer_socket > Peer_socket_ptr
Equivalent to Peer_socket::Ptr, but can't use that due to C++'s circular reference nonsense.
Mutex m_mutex
This object's mutex.
Error_code disconnect_cause() const
The error code that perviously caused state() to become State::S_CLOSED, or success code if state is ...
Peer_socket_options const *const m_child_sock_opts
Either null or the pointer to a copy of the template Peer_socket_options intended for resulting Peer_...
State m_state
See state(). Should be set before user gets access to *this. Must not be modified by non-W threads.
util::Linked_hash_set< Peer_socket_ptr > m_unaccepted_socks
Queue of passively opened sockets in Peer_socket::Int_state::S_ESTABLISHED internal state that have n...
Peer_socket_ptr sync_accept_impl(const Fine_time_pt &wait_until, bool reactor_pattern, Error_code *err_code)
Same as sync_accept() but uses a Fine_clock-based Fine_duration non-template type for implementation ...
State
State of a Server_socket.
State state() const
Current State of the socket.
flow_port_t m_local_port
See local_port().
~Server_socket() override
Boring virtual destructor. Note that deletion is to be handled exclusively via shared_ptr,...
flow_port_t local_port() const
The local Flow-protocol port on which this server is or was listening.
util::Lock_guard< Mutex > Lock_guard
Short-hand for RAII lock guard of Mutex.
Node * node() const
Node that produced this Server_socket.
Error_code m_disconnect_cause
The Error_code causing this server's move from LISTENING state (if this has occurred); otherwise a cl...
Peer_socket_ptr accept(Error_code *err_code=0)
Non-blocking accept: obtain socket for the least recently established not-yet-obtained peer connectio...
An empty interface, consisting of nothing but a default virtual destructor, intended as a boiler-plat...
Convenience class template that endows the given subclass T with nested aliases Ptr and Const_ptr ali...
Flow module containing the API and implementation of the Flow network protocol, a TCP-inspired stream...
uint16_t flow_port_t
Logical Flow port type (analogous to a UDP/TCP port in spirit but in no way relevant to UDP/TCP).
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...
Fine_time_pt chrono_duration_from_now_to_fine_time_pt(const boost::chrono::duration< Rep, Period > &dur)
Helper that takes a non-negative duration of arbitrary precision/period and converts it to Fine_durat...
boost::unique_lock< Mutex > Lock_guard
Short-hand for advanced-capability RAII lock guard for any mutex, ensuring exclusive ownership of tha...
boost::recursive_mutex Mutex_recursive
Short-hand for reentrant, exclusive mutex.
boost::system::error_code Error_code
Short-hand for a boost.system error code (which basically encapsulates an integer/enum error code and...
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.
A set of low-level options affecting a single Peer_socket.