Bitcoin Core 32.99.0
P2P Digital Currency
Public Member Functions | List of all members
ipc::Process Class Referenceabstract

IPC process interface for spawning bitcoin processes and serving requests in processes that have been spawned. More...

#include <process.h>

Public Member Functions

virtual ~Process ()=default
 
virtual std::tuple< mp::ProcessId, mp::SocketId > spawn (const std::string &new_exe_name, const fs::path &argv0_path)=0
 Spawn process and return socket id for communicating with it. More...
 
virtual int waitSpawned (mp::ProcessId pid)=0
 Wait for spawned process to exit and return its exit code. More...
 
virtual std::optional< mp::SocketId > checkSpawned (int argc, char *argv[])=0
 Parse command line and determine if current process is a spawned child process. More...
 
virtual mp::SocketId connect (const fs::path &data_dir, const std::string &dest_exe_name, std::string &address)=0
 Canonicalize and connect to address, returning socket id. More...
 
virtual mp::SocketId bind (const fs::path &data_dir, const std::string &exe_name, std::string &address)=0
 Create listening socket, bind and canonicalize address, and return socket id. More...
 

Detailed Description

IPC process interface for spawning bitcoin processes and serving requests in processes that have been spawned.

There will be different implementations of this interface depending on the platform (e.g. unix, windows).

Definition at line 23 of file process.h.

Constructor & Destructor Documentation

◆ ~Process()

virtual ipc::Process::~Process ( )
virtualdefault

Member Function Documentation

◆ bind()

virtual mp::SocketId ipc::Process::bind ( const fs::path &  data_dir,
const std::string &  exe_name,
std::string &  address 
)
pure virtual

Create listening socket, bind and canonicalize address, and return socket id.

◆ checkSpawned()

virtual std::optional< mp::SocketId > ipc::Process::checkSpawned ( int  argc,
char *  argv[] 
)
pure virtual

Parse command line and determine if current process is a spawned child process.

If so, return a socket id for communicating with the parent process, otherwise return std::nullopt.

◆ connect()

virtual mp::SocketId ipc::Process::connect ( const fs::path &  data_dir,
const std::string &  dest_exe_name,
std::string &  address 
)
pure virtual

Canonicalize and connect to address, returning socket id.

◆ spawn()

virtual std::tuple< mp::ProcessId, mp::SocketId > ipc::Process::spawn ( const std::string &  new_exe_name,
const fs::path &  argv0_path 
)
pure virtual

Spawn process and return socket id for communicating with it.

◆ waitSpawned()

virtual int ipc::Process::waitSpawned ( mp::ProcessId  pid)
pure virtual

Wait for spawned process to exit and return its exit code.


The documentation for this class was generated from the following file: