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

IPC protocol interface for calling IPC methods over sockets. More...

#include <protocol.h>

Public Member Functions

virtual ~Protocol ()=default
 
virtual std::unique_ptr< interfaces::Initconnect (int fd, const char *exe_name)=0
 Return Init interface that forwards requests over given socket descriptor. More...
 
virtual void serve (int fd, const char *exe_name, interfaces::Init &init)=0
 Handle requests on provided socket descriptor, forwarding them to the provided Init interface. More...
 
virtual void addCleanup (std::type_index type, void *iface, std::function< void()> cleanup)=0
 Add cleanup callback to interface that will run when the interface is deleted. More...
 
virtual Contextcontext ()=0
 Context accessor. More...
 

Detailed Description

IPC protocol interface for calling IPC methods over sockets.

There may be different implementations of this interface for different IPC protocols (e.g. Cap'n Proto, gRPC, JSON-RPC, or custom protocols).

Definition at line 21 of file protocol.h.

Constructor & Destructor Documentation

◆ ~Protocol()

virtual ipc::Protocol::~Protocol ( )
virtualdefault

Member Function Documentation

◆ addCleanup()

virtual void ipc::Protocol::addCleanup ( std::type_index  type,
void *  iface,
std::function< void()>  cleanup 
)
pure virtual

Add cleanup callback to interface that will run when the interface is deleted.

◆ connect()

virtual std::unique_ptr<interfaces::Init> ipc::Protocol::connect ( int  fd,
const char *  exe_name 
)
pure virtual

Return Init interface that forwards requests over given socket descriptor.

Socket communication is handled on a background thread.

◆ context()

virtual Context& ipc::Protocol::context ( )
pure virtual

Context accessor.

◆ serve()

virtual void ipc::Protocol::serve ( int  fd,
const char *  exe_name,
interfaces::Init init 
)
pure virtual

Handle requests on provided socket descriptor, forwarding them to the provided Init interface.

Socket communication is handled on the current thread, and this call blocks until the socket is closed.


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