46 using Ptr = boost::shared_ptr<Server_socket>;
133 template<
typename Rep,
typename Period,
typename Handler>
134 void async_accept(
const boost::chrono::duration<Rep, Period>& max_wait,
135 bool reactor_pattern,
136 const Handler& on_result);
147 template<
typename Handler>
161 template<
typename Rep,
typename Period,
typename Handler>
162 void async_accept(
const boost::chrono::duration<Rep, Period>& max_wait,
163 const Handler& on_result);
176 template<
typename Handler>
177 void async_accept(
bool reactor_pattern,
const Handler& on_result);
246 template<
typename Handler>
259template<
typename Rep,
typename Period,
typename Handler>
261 bool reactor_pattern,
262 const Handler& on_result)
269template<
typename Handler>
275template<
typename Handler>
281template<
typename Rep,
typename Period,
typename Handler>
283 const Handler& on_result)
290template<
typename Handler>
293 using boost::asio::post;
294 using boost::asio::bind_executor;
295 using boost::asio::get_associated_executor;
300 return [
this, on_result = std::move(on_result)]
304 const auto executor = get_associated_executor(on_result);
306 bind_executor(executor,
307 [err_code, new_sock, on_result = std::move(on_result)]
309 on_result(err_code, new_sock);
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...
A subclass of net_flow::Node that adds the ability to easily and directly use net_flow sockets in gen...
boost::shared_ptr< Peer_socket > Ptr
Short-hand for shared_ptr to Peer_socket.
A net_flow::Server_socket that adds integration with boost.asio.
void async_accept_impl(Handler_func &&on_result, const Fine_time_pt &wait_until, bool reactor_pattern)
De-templated implementation of all async_accept() methods.
Server_socket(log::Logger *logger, const Peer_socket_options *child_sock_opts)
Constructs object.
void set_async_task_engine(util::Task_engine *target_async_task_engine)
Overwrites the value to be returned by next async_task_engine().
~Server_socket() override
Boring virtual destructor as in superclass. See notes there.
const util::Task_engine & async_task_engine_cref() const
Read-only version of async_task_engine().
static Ptr cast(net_flow::Server_socket::Ptr serv)
Convenience method that polymorphically casts from net_flow::Server_socket::Ptr to subclass pointer n...
util::Task_engine * async_task_engine()
Pointer (possibly null) for the flow::util::Task_engine used by any coming async I/O calls and inheri...
void async_accept(const boost::chrono::duration< Rep, Period > &max_wait, bool reactor_pattern, const Handler &on_result)
boost.asio-style asynchronous version that essentially performs net_flow::Server_socket::sync_accept(...
Handler_func handler_func(Handler &&on_result)
Returns a functor that essentially performs post() on_result onto *async_task_engine() in a way suita...
boost::shared_ptr< Server_socket > Ptr
Short-hand for shared_ptr to Server_socket.
Function< void(const Error_code &err_code, Peer_socket::Ptr new_sock)> Handler_func
Short-hand for the Task_engine-compatible accept Handler concrete type for class-internal code.
util::Task_engine * m_target_task_engine
See async_task_engine().
boost::shared_ptr< Server_socket > Ptr
Short-hand for ref-counted pointer to mutable values of type Target_type::element_type (a-la T*).
Contains classes that add boost.asio integration to the main Flow-protocol classes such as net_flow::...
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::asio::io_service Task_engine
Short-hand for boost.asio event service, the central class of boost.asio.
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.