23#include <boost/move/make_unique.hpp>
43 using boost::movelib::make_unique;
47 m_impl = make_unique<Impl>(
nullptr,
"");
64 m_impl(boost::movelib::make_unique<
Impl>(logger_ptr, nickname_str))
71 m_impl(boost::movelib::make_unique<
Impl>(logger_ptr, nickname_str, std::move(native_peer_socket_moved)))
77 m_impl(boost::movelib::make_unique<
Impl>(std::move(sync_io_core_in_peer_state_moved)))
86 return impl()->nickname();
91 return impl()->sync_connect(absolute_name, err_code);
96 return impl()->remote_peer_process_credentials(err_code);
101 return impl()->send_meta_blob_max_size();
106 return impl()->send_blob_max_size();
112 return impl()->send_native_handle(hndl_or_null, meta_blob, err_code);
117 return impl()->send_blob(blob, err_code);
122 return impl()->end_sending();
127 return impl()->auto_ping(period);
132 return impl()->receive_meta_blob_max_size();
137 return impl()->receive_blob_max_size();
142 return impl()->idle_timer_run(timeout);
149 return os << *(val.
impl());
156 return impl()->async_end_sending(std::move(on_done_func));
161 flow::async::Task_asio_err_sz&& on_done_func)
163 return impl()->async_receive_native_handle(target_hndl, target_meta_blob, std::move(on_done_func));
167 flow::async::Task_asio_err_sz&& on_done_func)
169 return impl()->async_receive_blob(target_blob, std::move(on_done_func));
Internal, non-movable pImpl implementation of Native_socket_stream class.
Implements both Native_handle_sender and Native_handle_receiver concepts by using a stream-oriented U...
Impl_ptr & impl() const
Helper that simply returns m_impl while guaranteeing that m_impl is non-null upon return.
size_t send_blob_max_size() const
Implements Blob_sender API per contract.
bool idle_timer_run(util::Fine_duration timeout=boost::chrono::seconds(5))
Implements Native_handle_receiver, Blob_receiver API per contract.
~Native_socket_stream()
Implements Native_handle_sender and Native_handle_receiver APIs at the same time, per their concept c...
const std::string & nickname() const
Returns nickname, a brief string suitable for logging.
bool send_blob(const util::Blob_const &blob, Error_code *err_code=0)
Implements Blob_sender API per contract.
bool send_native_handle(Native_handle hndl_or_null, const util::Blob_const &meta_blob, Error_code *err_code=0)
Implements Native_handle_sender API per contract.
bool async_receive_blob_fwd(const util::Blob_mutable &target_blob, flow::async::Task_asio_err_sz &&on_done_func)
Template-free version of async_receive_blob() as required by pImpl idiom.
static const Shared_name & S_RESOURCE_TYPE_ID
Implements concept API.
size_t send_meta_blob_max_size() const
Implements Native_handle_sender API per contract.
bool sync_connect(const Shared_name &absolute_name, Error_code *err_code=0)
To be invoked in NULL state only, it synchronously and non-blockingly attempts to connect to an oppos...
bool async_end_sending_fwd(flow::async::Task_asio_err &&on_done_func)
Template-free version of async_end_sending() as required by pImpl idiom.
bool auto_ping(util::Fine_duration period=boost::chrono::seconds(2))
Implements Native_handle_sender, Blob_sender API per contract.
Native_socket_stream()
Default ctor (object is in NULL state).
bool async_receive_native_handle_fwd(Native_handle *target_hndl, const util::Blob_mutable &target_meta_blob, flow::async::Task_asio_err_sz &&on_done_func)
Template-free version of async_receive_native_handle() as required by pImpl idiom.
std::experimental::propagate_const< boost::movelib::unique_ptr< Impl > > Impl_ptr
Short-hand for const-respecting wrapper around Native_socket_stream::Impl for the pImpl idiom.
Impl_ptr m_impl
The true implementation of this class.
size_t receive_meta_blob_max_size() const
Implements Native_handle_receiver API per contract.
bool end_sending()
Implements Native_handle_sender, Blob_sender API per contract.
size_t receive_blob_max_size() const
Implements Blob_receiver API per contract.
util::Process_credentials remote_peer_process_credentials(Error_code *err_code=0) const
OS-reported process credential (PID, etc.) info about the other connected peer's process,...
Native_socket_stream & operator=(Native_socket_stream &&src)
Move-assigns from src; *this acts as if destructed; src becomes as-if default-cted (therefore in NULL...
Implements both sync_io::Native_handle_sender and sync_io::Native_handle_receiver concepts by using a...
A process's credentials (PID, UID, GID as of this writing).
String-wrapping abstraction representing a name uniquely distinguishing a kernel-persistent entity fr...
Flow-IPC module providing transmission of structured messages and/or low-level blobs (and more) betwe...
util::Shared_name Shared_name
Convenience alias for the commonly used type util::Shared_name.
std::ostream & operator<<(std::ostream &os, const Bipc_mq_handle &val)
Prints string representation of the given Bipc_mq_handle to the given ostream.
boost::asio::mutable_buffer Blob_mutable
Short-hand for an mutable blob somewhere in memory, stored as exactly a void* and a size_t.
flow::Fine_duration Fine_duration
Short-hand for Flow's Fine_duration.
boost::asio::const_buffer Blob_const
Short-hand for an immutable blob somewhere in memory, stored as exactly a void const * and a size_t.
flow::util::String_view String_view
Short-hand for Flow's String_view.
flow::Error_code Error_code
Short-hand for flow::Error_code which is very common.
A monolayer-thin wrapper around a native handle, a/k/a descriptor a/k/a FD.