22#include <boost/move/make_unique.hpp>
42 : (
m_impl = boost::movelib::make_unique<Impl>(
nullptr,
""));
54 m_impl(boost::movelib::make_unique<
Impl>(logger_ptr, nickname_str))
61 m_impl(boost::movelib::make_unique<
Impl>(logger_ptr, nickname_str, std::move(native_peer_socket_moved)))
67 m_impl(boost::movelib::make_unique<
Impl>(std::move(sync_io_core_in_peer_state_moved)))
76 return impl()->nickname();
81 return impl()->sync_connect(absolute_name, err_code);
86 return impl()->remote_peer_process_credentials(err_code);
91 return impl()->remote_peer_process_credentials(creds);
96 return impl()->send_meta_blob_max_size();
101 return impl()->send_blob_max_size();
107 return impl()->send_native_handle(hndl_or_null, meta_blob, err_code);
112 return impl()->send_blob(blob, err_code);
117 return impl()->end_sending();
122 return impl()->auto_ping(period);
127 return impl()->blob_send_stats();
132 impl()->blob_send_stats_reset();
137 return impl()->native_handle_send_stats();
142 impl()->native_handle_send_stats_reset();
147 return impl()->receive_meta_blob_max_size();
152 return impl()->receive_blob_max_size();
157 return impl()->idle_timer_run(timeout);
162 return impl()->blob_receive_stats();
167 impl()->blob_receive_stats_reset();
172 return impl()->native_handle_receive_stats();
177 impl()->native_handle_receive_stats_reset();
184 return os << *(val.
impl());
Internal, non-movable pImpl-lite implementation of Native_socket_stream class.
Implements both Native_handle_sender and Native_handle_receiver concepts by using a Unix domain socke...
Blob_rcv_stats native_handle_receive_stats() const
Returns the same stats as blob_receive_stats(): since this transport uses a single Unix-domain-socket...
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.
~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 sync_connect(const Shared_name &absolute_name, Error_code *err_code=nullptr)
To be invoked in NULL state only, it synchronously and non-blockingly attempts to connect to an oppos...
Blob_snd_stats native_handle_send_stats() const
Returns the same stats as blob_send_stats(): since this transport uses a single Unix-domain-socket pi...
static const Shared_name & S_RESOURCE_TYPE_ID
Implements concept API.
void native_handle_receive_stats_reset()
Equivalent to blob_receive_stats_reset(); see blob_receive_stats() rationale.
bool idle_timer_run(util::Fine_duration timeout=boost::chrono::seconds{5})
Implements Native_handle_receiver, Blob_receiver API per contract.
bool send_native_handle(Native_handle hndl_or_null, const util::Blob_const &meta_blob, Error_code *err_code=nullptr)
Implements Native_handle_sender API per contract.
void blob_receive_stats_reset()
Implements Blob_receiver API per contract.
size_t send_meta_blob_max_size() const
Implements Native_handle_sender API per contract.
void blob_send_stats_reset()
Implements Blob_sender API per contract.
bool auto_ping(util::Fine_duration period=boost::chrono::seconds{2})
Implements Native_handle_sender, Blob_sender API per contract.
void native_handle_send_stats_reset()
Equivalent to blob_send_stats_reset(); see blob_send_stats() rationale.
const util::Process_credentials & remote_peer_process_credentials(Error_code *err_code=nullptr) const
OS-reported process credential (PID, etc.) info about the other connected peer's process,...
Native_socket_stream()
Default ctor (object is in NULL state).
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-lite 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.
Blob_snd_stats blob_send_stats() const
Implements Blob_sender API per contract.
size_t receive_blob_max_size() const
Implements Blob_receiver API per contract.
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...
bool send_blob(const util::Blob_const &blob, Error_code *err_code=nullptr)
Implements Blob_sender API per contract.
Blob_rcv_stats blob_receive_stats() const
Implements Blob_receiver API per contract.
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...
std::ostream & operator<<(std::ostream &os, const Generic_msg_batch_in< Msg_resource_t, NO_HNDLS > &val)
Prints string representation of the given Generic_msg_batch_in to the given ostream.
util::Shared_name Shared_name
Convenience alias for the commonly used type util::Shared_name.
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.
Cumulative stats from the incoming-direction (receive) pipe of a Blob_receiver or Native_handle_recei...
Cumulative stats from the outgoing-direction (send) pipe of a Blob_sender or Native_handle_sender con...
A monolayer-thin wrapper around a native handle, a/k/a descriptor a/k/a FD.