21#include <boost/move/make_unique.hpp>
45 : (
m_impl = boost::movelib::make_unique<Impl>(
nullptr,
""));
59 m_impl(boost::movelib::make_unique<
Impl>(logger_ptr, nickname_str))
66 m_impl(boost::movelib::make_unique<
Impl>(logger_ptr, nickname_str, std::move(native_peer_socket_moved)))
75 return impl()->nickname();
80 return impl()->sync_connect(absolute_name, err_code);
86 auto sock = std::move(*
this);
87 sock.impl()->reset_sync_io_setup();
94 return impl()->remote_peer_process_credentials(err_code);
99 return impl()->remote_peer_process_credentials(creds);
104 return impl()->send_meta_blob_max_size();
109 return impl()->send_blob_max_size();
115 return impl()->send_native_handle(hndl_or_null, meta_blob, err_code);
120 return impl()->send_blob(blob, err_code);
125 return impl()->end_sending();
130 return impl()->auto_ping(period);
135 return impl()->blob_send_stats();
140 impl()->blob_send_stats_reset();
145 return impl()->native_handle_send_stats();
150 impl()->native_handle_send_stats_reset();
155 return impl()->receive_meta_blob_max_size();
160 return impl()->receive_blob_max_size();
165 return impl()->idle_timer_run(timeout);
170 return impl()->blob_receive_stats();
175 impl()->blob_receive_stats_reset();
180 return impl()->native_handle_receive_stats();
185 impl()->native_handle_receive_stats_reset();
190 return impl()->get_logger();
197 return os << *(val.
impl());
Internal, non-movable pImpl-lite implementation of sync_io::Native_socket_stream class.
Implements both sync_io::Native_handle_sender and sync_io::Native_handle_receiver concepts by using a...
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.
const util::Process_credentials & remote_peer_process_credentials(Error_code *err_code=nullptr) const
See transport::Native_socket_stream counterpart.
static const Shared_name S_RESOURCE_TYPE_ID
Implements concept API.
Native_socket_stream()
Default ctor (object is in NULL state).
Blob_snd_stats blob_send_stats() const
Implements sync_io::Blob_sender API per contract.
std::experimental::propagate_const< boost::movelib::unique_ptr< Impl > > Impl_ptr
Short-hand for const-respecting wrapper around Impl for the pImpl-lite idiom.
void blob_send_stats_reset()
Implements sync_io::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.
bool end_sending()
Implements Native_handle_sender, 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.
const std::string & nickname() const
Returns nickname, a brief string suitable for logging.
Blob_rcv_stats native_handle_receive_stats() const
Implements sync_io::Native_handle_receiver API per contract.
bool sync_connect(const Shared_name &absolute_name, Error_code *err_code=nullptr)
Identical to Async_io_obj counterpart.
void native_handle_send_stats_reset()
Implements sync_io::Native_handle_sender API per contract. Identical to blob_send_stats_reset().
Impl_ptr & impl() const
Helper that simply returns m_impl while guaranteeing that m_impl is non-null upon return.
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...
size_t send_meta_blob_max_size() const
Implements Native_handle_sender API per contract.
Impl_ptr m_impl
The true implementation of this class.
Blob_rcv_stats blob_receive_stats() const
Implements sync_io::Blob_receiver API per contract.
size_t receive_blob_max_size() const
Implements Blob_receiver API per contract.
size_t send_blob_max_size() const
Implements Blob_sender API per contract.
flow::log::Logger * get_logger() const
Returns logger (possibly null).
bool send_blob(const util::Blob_const &blob, Error_code *err_code=nullptr)
Implements Blob_sender API per contract.
size_t receive_meta_blob_max_size() const
Implements Native_handle_receiver API per contract.
~Native_socket_stream()
Implements Native_handle_sender and Native_handle_receiver APIs at the same time, per their concept c...
void native_handle_receive_stats_reset()
Implements sync_io::Native_handle_receiver API per contract. Identical to blob_receive_stats_reset().
void blob_receive_stats_reset()
Implements sync_io::Blob_receiver API per contract.
Blob_snd_stats native_handle_send_stats() const
Implements sync_io::Native_handle_sender API per contract.
A process's credentials (PID, UID, GID as of this writing).
String-wrapping abstraction representing a name uniquely distinguishing a kernel-persistent entity fr...
static Shared_name ct(const Source &src)
Copy-constructs from a char-sequence container such as string or util::String_view.
sync_io-pattern counterparts to async-I/O-pattern object types in parent namespace ipc::transport.
std::ostream & operator<<(std::ostream &os, const Native_socket_stream_impl &val)
Prints string representation of the given Native_socket_stream_impl 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.