5#ifndef BITCOIN_INTERFACES_IPC_H
6#define BITCOIN_INTERFACES_IPC_H
88 template<
typename Interface>
100 virtual void addCleanup(std::type_index type,
void*
iface, std::function<
void()> cleanup) = 0;
Initial interface created when a process is first started, and used to give and get access to other i...
Interface providing access to interprocess-communication (IPC) functionality.
virtual ipc::Context & context()=0
IPC context struct accessor (see struct definition for more description).
virtual std::unique_ptr< Init > spawnProcess(const char *exe_name)=0
Spawn a child process returning pointer to its Init interface.
virtual void listenAddress(ipc::ListenAddress &listen_address)=0
Listen on a configured socket address exposing this process's init interface and accepting at most li...
virtual void disconnectIncoming()=0
Disconnect any incoming connections that are still connected.
virtual bool startSpawnedProcess(int argc, char *argv[], int &exit_status)=0
If this is a spawned process, block and handle requests from the parent process by forwarding them to...
virtual void addCleanup(std::type_index type, void *iface, std::function< void()> cleanup)=0
Internal implementation of public addCleanup method (above) as a type-erased virtual function,...
void addCleanup(Interface &iface, std::function< void()> cleanup)
Add cleanup callback to remote interface that will run when the interface is deleted.
static util::Result< ipc::ListenAddress > parseListenAddress(std::string address)
Parse an IPC listening address and its per-listener options.
virtual std::unique_ptr< Init > connectAddress(std::string &address)=0
Connect to a socket address and return a pointer to its Init interface.
is a home for public enum and struct type definitions that are used internally by ipc code,...
std::unique_ptr< Ipc > MakeIpc(const char *exe_name, const char *process_argv0, Init &init)
Return implementation of Ipc interface.
Context struct used to give IPC protocol implementations or implementation hooks access to applicatio...
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.