Bitcoin Core
32.1.0
P2P Digital Currency
Toggle main menu visibility
Loading...
Searching...
No Matches
src
ipc
process.h
Go to the documentation of this file.
1
// Copyright (c) 2021-present The Bitcoin Core developers
2
// Distributed under the MIT software license, see the accompanying
3
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5
#ifndef BITCOIN_IPC_PROCESS_H
6
#define BITCOIN_IPC_PROCESS_H
7
8
#include <
util/fs.h
>
9
10
#include <memory>
11
#include <
ipc/util.h
>
12
#include <string>
13
14
namespace
ipc
{
15
class
Protocol
;
16
22
class
Process
23
{
24
public
:
25
virtual
~Process
() =
default
;
26
28
virtual
std::tuple<mp::ProcessId, mp::SocketId>
spawn
(
const
std::string& new_exe_name,
const
fs::path& argv0_path) = 0;
29
31
virtual
int
waitSpawned
(
mp::ProcessId
pid) = 0;
32
36
virtual
bool
checkSpawned
(
int
argc,
char
* argv[],
mp::SocketId
& socket) = 0;
37
39
virtual
mp::SocketId
connect
(
const
fs::path& data_dir,
40
const
std::string& dest_exe_name,
41
std::string& address) = 0;
42
44
virtual
mp::SocketId
bind
(
const
fs::path& data_dir,
45
const
std::string& exe_name,
46
std::string& address) = 0;
47
};
48
51
std::unique_ptr<Process>
MakeProcess
();
52
}
// namespace ipc
53
54
#endif
// BITCOIN_IPC_PROCESS_H
ipc::Process
Definition
process.h:23
ipc::Process::connect
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.
ipc::Process::~Process
virtual ~Process()=default
ipc::Process::checkSpawned
virtual bool checkSpawned(int argc, char *argv[], mp::SocketId &socket)=0
ipc::Process::bind
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.
ipc::Process::waitSpawned
virtual int waitSpawned(mp::ProcessId pid)=0
Wait for spawned process to exit and return its exit code.
ipc::Process::spawn
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.
ipc::Protocol
Definition
protocol.h:23
fs.h
util.h
ipc
Definition
ipc.h:14
ipc::MakeProcess
std::unique_ptr< Process > MakeProcess()
Definition
process.cpp:157
mp::SocketId
int SocketId
Definition
util.h:27
mp::ProcessId
int ProcessId
Definition
util.h:26
Generated on
for Bitcoin Core by
1.18.0