25#include <flow/log/log.hpp>
26#include <flow/async/util.hpp>
27#include <experimental/propagate_const>
291 const std::string&
nickname()
const;
312 template<
typename Create_ev_wait_hndl_func>
359 template<
typename Event_wait_func_t>
375 template<
typename Event_wait_func_t>
435 template<
typename Task_err>
491 template<
typename Event_wait_func_t>
508 template<
typename Event_wait_func_t>
536 template<
typename Task_err_sz>
539 Task_err_sz&& on_done_func);
564 template<
typename Task_err_sz>
566 Task_err_sz&& on_done_func);
613 using Impl_ptr = std::experimental::propagate_const<boost::movelib::unique_ptr<Impl>>;
620 friend std::ostream&
operator<<(std::ostream& os,
const Impl& val);
713 flow::async::Task_asio_err_sz&& on_done_func);
731 flow::async::Task_asio_err_sz&& on_done_func);
770template<
typename Create_ev_wait_hndl_func>
778template<
typename Event_wait_func_t>
786template<
typename Event_wait_func_t>
794template<
typename Task_err>
797 using flow::async::Task_asio_err;
806template<
typename Event_wait_func_t>
814template<
typename Event_wait_func_t>
822template<
typename Task_err_sz>
826 Task_err_sz&& on_done_func)
828 using flow::async::Task_asio_err_sz;
831 Task_asio_err_sz(std::move(on_done_func)));
834template<
typename Task_err_sz>
836 Error_code* sync_err_code,
size_t* sync_sz, Task_err_sz&& on_done_func)
838 using flow::async::Task_asio_err_sz;
840 return async_receive_blob_fwd(target_blob, sync_err_code, sync_sz, Task_asio_err_sz(std::move(on_done_func)));
Implements both Native_handle_sender and Native_handle_receiver concepts by using a stream-oriented U...
Dummy type for use as a template param to Channel when either the blobs pipe or handles pipe is disab...
Internal, non-movable pImpl 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...
static const size_t & S_MAX_META_BLOB_LENGTH
The maximum length of a blob that can be sent by this protocol.
bool async_receive_native_handle(Native_handle *target_hndl, const util::Blob_mutable &target_meta_blob, Error_code *sync_err_code, size_t *sync_sz, Task_err_sz &&on_done_func)
Implements Native_handle_receiver API per contract.
Native_socket_stream(Native_socket_stream &&src)
Move-constructs from src; src becomes as-if default-cted (therefore in NULL state).
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,...
bool async_end_sending_fwd(Error_code *sync_err_code, flow::async::Task_asio_err &&on_done_func)
Template-free version of async_end_sending() as required by pImpl idiom.
bool start_send_blob_ops(Event_wait_func_t &&ev_wait_func)
Implements Blob_sender API per contract.
bool start_send_native_handle_ops(Event_wait_func_t &&ev_wait_func)
Implements Native_handle_sender API per contract.
static const Shared_name S_RESOURCE_TYPE_ID
Implements concept API.
bool send_blob(const util::Blob_const &blob, Error_code *err_code=0)
Implements Blob_sender API per contract.
bool sync_connect(const Shared_name &absolute_name, Error_code *err_code=0)
Identical to Async_io_obj counterpart.
Native_socket_stream()
Default ctor (object is in NULL state).
Native_socket_stream & operator=(const Native_socket_stream &)=delete
Copy assignment is disallowed.
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.
Native_socket_stream(const Native_socket_stream &)=delete
Copy construction is disallowed.
bool end_sending()
Implements Native_handle_sender, Blob_sender API per contract.
static constexpr bool S_BLOB_UNDERFLOW_ALLOWED
Implements concept API; namely it is true.
bool replace_event_wait_handles_fwd(const Function< util::sync_io::Asio_waitable_native_handle()> &create_ev_wait_hndl_func)
Template-free version of replace_event_wait_handles() as required by pImpl idiom.
const std::string & nickname() const
Returns nickname, a brief string suitable for logging.
bool async_receive_blob_fwd(const util::Blob_mutable &target_blob, Error_code *sync_err_code, size_t *sync_sz, flow::async::Task_asio_err_sz &&on_done_func)
Template-free version of async_receive_blob() as required by pImpl idiom.
bool async_receive_blob(const util::Blob_mutable &target_blob, Error_code *sync_err_code, size_t *sync_sz, Task_err_sz &&on_done_func)
Implements Blob_receiver API per contract.
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...
bool start_receive_blob_ops(Event_wait_func_t &&ev_wait_func)
Implements Blob_receiver API per contract.
size_t send_meta_blob_max_size() const
Implements Native_handle_sender API per contract.
bool start_send_blob_ops_fwd(util::sync_io::Event_wait_func &&ev_wait_func)
Template-free version of start_send_blob_ops() as required by pImpl idiom.
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.
Impl_ptr m_impl
The true implementation of this class.
bool start_send_native_handle_ops_fwd(util::sync_io::Event_wait_func &&ev_wait_func)
Template-free version of start_send_native_handle_ops() as required by pImpl idiom.
size_t receive_blob_max_size() const
Implements Blob_receiver API per contract.
static constexpr bool S_META_BLOB_UNDERFLOW_ALLOWED
Implements concept API; namely it is true.
size_t send_blob_max_size() const
Implements Blob_sender API per contract.
flow::log::Logger * get_logger() const
Returns logger (possibly null).
bool auto_ping(util::Fine_duration period=boost::chrono::seconds(2))
Implements Native_handle_sender, Blob_sender API per contract.
bool async_receive_native_handle_fwd(Native_handle *target_hndl, const util::Blob_mutable &target_meta_blob, Error_code *sync_err_code, size_t *sync_sz, flow::async::Task_asio_err_sz &&on_done_func)
Template-free version of async_receive_native_handle() as required by pImpl idiom.
friend std::ostream & operator<<(std::ostream &os, const Native_socket_stream &val)
Friend of Native_socket_stream.
bool idle_timer_run(util::Fine_duration timeout=boost::chrono::seconds(5))
Implements Native_handle_receiver, Blob_receiver API per contract.
bool start_receive_native_handle_ops(Event_wait_func_t &&ev_wait_func)
Implements Native_handle_receiver API per contract.
size_t receive_meta_blob_max_size() const
Implements Native_handle_receiver API per contract.
bool start_receive_native_handle_ops_fwd(util::sync_io::Event_wait_func &&ev_wait_func)
Template-free version of start_receive_native_handle_ops() as required by pImpl idiom.
~Native_socket_stream()
Implements Native_handle_sender and Native_handle_receiver APIs at the same time, per their concept c...
bool start_receive_blob_ops_fwd(util::sync_io::Event_wait_func &&ev_wait_func)
Template-free version of start_receive_blob_ops() as required by pImpl idiom.
static constexpr bool S_TRANSMIT_NATIVE_HANDLES
Useful for generic programming: true to indicate a *this has a send_native_handle() and an async_rece...
bool replace_event_wait_handles(const Create_ev_wait_hndl_func &create_ev_wait_hndl_func)
Implements Native_handle_sender and Native_handle_receiver APIs at the same time, per their concept c...
bool async_end_sending(Error_code *sync_err_code, Task_err &&on_done_func)
Implements Native_handle_sender, Blob_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...
Useful if using the sync_io pattern within a user event loop built on boost.asio (optionally with flo...
sync_io-pattern counterparts to async-I/O-pattern object types in parent namespace ipc::transport.
Function< void(Asio_waitable_native_handle *hndl_of_interest, bool ev_of_interest_snd_else_rcv, Task_ptr &&on_active_ev_func)> Event_wait_func
In sync_io pattern, concrete type storing user-supplied function invoked by pattern-implementing ipc:...
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.
flow::Function< Signature > Function
Short-hand for polymorphic functor holder which is very common. This is essentially std::function.
A monolayer-thin wrapper around a native handle, a/k/a descriptor a/k/a FD.