30 m_target_task_engine(0)
33 FLOW_LOG_TRACE(
"boost.asio-integrated Server_socket [" <<
static_cast<void*
>(
this) <<
"] created; no Task_engine.");
38 FLOW_LOG_TRACE(
"boost.asio-integrated Server_socket [" <<
this <<
"] destroyed.");
55 FLOW_LOG_INFO(
"Object [" <<
this <<
"] has been assigned an Task_engine at [" << target_async_task_engine <<
"]; "
67 const auto owner_node =
static_cast<Node*
>(
node());
74 FLOW_LOG_WARNING(
"Cannot perform async op on object [" <<
this <<
"]: it is already closed for "
75 "reason [" << err_code <<
'/' << err_code.message() <<
"].");
80 assert(!on_result.empty());
82 const auto serv =
cast(shared_from_this());
102 std::move(non_blocking_func),
104 std::move(on_result));
109 using boost::static_pointer_cast;
110 return static_pointer_cast<Server_socket>(serv);
118 const auto serv =
static_cast<Server_socket*
>(serv_create_forward_plus_ctor_args<Server_socket>(child_sock_opts));
132 ? (os <<
"Asio_flow_server [Task_engine@" <<
static_cast<const void*
>(&(serv->
async_task_engine_cref())) <<
"] ["
134 <<
"] @" <<
static_cast<const void*
>(serv))
135 : (os <<
"Asio_flow_server@null");
Interface that the user should implement, passing the implementing Logger into logging classes (Flow'...
@ S_SERVER_SOCKET_ACCEPTABLE
Event type specifying the condition of interest wherein a target Server_socket serv is such that call...
A server socket able to listen on a single Flow port for incoming connections and return peer sockets...
Error_code disconnect_cause() const
The error code that perviously caused state() to become State::S_CLOSED, or success code if state is ...
Node * node() const
Node that produced this Server_socket.
A subclass of net_flow::Node that adds the ability to easily and directly use net_flow sockets in gen...
util::Task_engine * m_target_task_engine
See async_task_engine().
net_flow::Server_socket * serv_create(const Peer_socket_options *child_sock_opts) override
Implements superclass API.
static Ptr cast(net_flow::Peer_socket::Ptr sock)
Convenience method that polymorphically casts from net_flow::Peer_socket::Ptr to subclass pointer net...
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...
boost::shared_ptr< Server_socket > Ptr
Short-hand for shared_ptr to Server_socket.
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*).
#define FLOW_LOG_INFO(ARG_stream_fragment)
Logs an INFO message into flow::log::Logger *get_logger() with flow::log::Component get_log_component...
#define FLOW_LOG_WARNING(ARG_stream_fragment)
Logs a WARNING message into flow::log::Logger *get_logger() with flow::log::Component get_log_compone...
#define FLOW_LOG_TRACE(ARG_stream_fragment)
Logs a TRACE message into flow::log::Logger *get_logger() with flow::log::Component get_log_component...
Contains classes that add boost.asio integration to the main Flow-protocol classes such as net_flow::...
std::ostream & operator<<(std::ostream &os, const Peer_socket *sock)
Prints string representation of given socket to given standard ostream and returns the latter.
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.