21#include <flow/error/error.hpp>
31 namespace bind_ns = flow::util::bind_ns;
32 using boost::system::system_error;
36 logger_ptr, bind_ns::cref(absolute_name), _1);
39 FLOW_LOG_SET_CONTEXT(logger_ptr, Log_component::S_TRANSPORT);
60 string abstract_namespace_name(
size_t(1),
'\0');
61 abstract_namespace_name += absolute_name.
str();
62 FLOW_LOG_TRACE(
"Abstract-namespace (Linux extension) name above consists of 1 NUL + the name "
63 "[" << absolute_name <<
"]; total of [" << abstract_namespace_name.
size() <<
"] bytes.");
66 auto& sys_err_code = *err_code;
71 endpoint.path(abstract_namespace_name);
74 catch (
const system_error& exc)
76 FLOW_LOG_WARNING(
"Unable to set up native local stream endpoint structure; "
77 "could be due to name length; details logged below.");
78 sys_err_code = exc.code();
79 FLOW_ERROR_SYS_ERROR_LOG_WARNING();
String-wrapping abstraction representing a name uniquely distinguishing a kernel-persistent entity fr...
const std::string & str() const
Returns (sans copying) ref to immutable entire wrapped name string, suitable to pass into sys calls w...
size_t size() const
Returns str().size().
Additional (versus boost.asio) APIs for advanced work with local stream (Unix domain) sockets includi...
Protocol::endpoint Endpoint
Short-hand for boost.asio Unix domain peer stream-socket endpoint.
Endpoint endpoint_at_shared_name(flow::log::Logger *logger_ptr, const Shared_name &absolute_name, Error_code *err_code)
Returns an Endpoint corresponding to the given absolute Shared_name, so that an Acceptor or Peer_sock...
flow::Error_code Error_code
Short-hand for flow::Error_code which is very common.