25#include <flow/log/log.hpp>
26#include <flow/async/util.hpp>
27#include <experimental/propagate_const>
458 const std::string&
nickname()
const;
590 template<
typename Task_err>
672 template<
typename Task_err_sz>
674 Task_err_sz&& on_done_func);
697 template<
typename Task_err_sz>
747 using Impl_ptr = std::experimental::propagate_const<boost::movelib::unique_ptr<Impl>>;
754 friend std::ostream&
operator<<(std::ostream& os,
const Impl& val);
808 flow::async::Task_asio_err_sz&& on_done_func);
820 flow::async::Task_asio_err_sz&& on_done_func);
837template<
typename Task_err>
840 using flow::async::Task_asio_err;
849template<
typename Task_err_sz>
852 Task_err_sz&& on_done_func)
854 using flow::async::Task_asio_err_sz;
859template<
typename Task_err_sz>
862 using flow::async::Task_asio_err_sz;
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.
Native_socket_stream(const Native_socket_stream &)=delete
Copy construction is disallowed.
Native_socket_stream & operator=(const Native_socket_stream &)=delete
Copy assignment is disallowed.
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 async_receive_native_handle(Native_handle *target_hndl, const util::Blob_mutable &target_meta_blob, Task_err_sz &&on_done_func)
Implements Native_handle_receiver API per contract.
bool send_blob(const util::Blob_const &blob, Error_code *err_code=0)
Implements Blob_sender API per contract.
Native_socket_stream(Native_socket_stream &&src)
Move-constructs from src; src becomes as-if default-cted (therefore in NULL state).
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.
static constexpr bool S_BLOB_UNDERFLOW_ALLOWED
Implements concept API; namely it is true: async_receive_blob() with smaller-than-receive_blob_max_si...
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.
static constexpr bool S_META_BLOB_UNDERFLOW_ALLOWED
Implements concept API; namely it is true: async_receive_native_handle() with smaller-than-receive_me...
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.
bool async_end_sending(Task_err &&on_done_func)
Implements Native_handle_sender, Blob_sender API per contract.
bool async_receive_blob(const util::Blob_mutable &target_blob, Task_err_sz &&on_done_func)
Implements Blob_receiver API per contract.
friend std::ostream & operator<<(std::ostream &os, const Native_socket_stream &val)
Friend of Native_socket_stream.
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...
Dummy type for use as a template param to Channel when either the blobs pipe or handles pipe is disab...
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...
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.