Inside Bitcoin
Opening the selected file…
Inside Bitcoin
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
1// Copyright (c) 2021-present The Bitcoin Core developers2// Distributed under the MIT software license, see the accompanying3// file COPYING or http://www.opensource.org/licenses/mit-license.php.5#ifndef BITCOIN_IPC_PROCESS_H6#define BITCOIN_IPC_PROCESS_H8#include <util/fs.h>10#include <memory>11#include <ipc/util.h>12#include <string>14namespace ipc {15class Protocol;17//! IPC process interface for spawning bitcoin processes and serving requests18//! in processes that have been spawned.19//!20//! There will be different implementations of this interface depending on the21//! platform (e.g. unix, windows).22class Process23{24public:25virtual ~Process() = default;27//! Spawn process and return socket id for communicating with it.28virtual std::tuple<mp::ProcessId, mp::SocketId> spawn(const std::string& new_exe_name, const fs::path& argv0_path) = 0;30//! Wait for spawned process to exit and return its exit code.31virtual int waitSpawned(mp::ProcessId pid) = 0;33//! Parse command line and determine if current process is a spawned child34//! process. If so, return true and a socket id for communicating35//! with the parent process.36virtual bool checkSpawned(int argc, char* argv[], mp::SocketId& socket) = 0;38//! Canonicalize and connect to address, returning socket id.39virtual mp::SocketId connect(const fs::path& data_dir,40const std::string& dest_exe_name,41std::string& address) = 0;43//! Create listening socket, bind and canonicalize address, and return socket id.44virtual mp::SocketId bind(const fs::path& data_dir,45const std::string& exe_name,46std::string& address) = 0;47};49//! Constructor for Process interface. Implementation will vary depending on50//! the platform (unix or windows).51std::unique_ptr<Process> MakeProcess();52} // namespace ipc54#endif // BITCOIN_IPC_PROCESS_H
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.