5#ifndef BITCOIN_IPC_PROTOCOL_H
6#define BITCOIN_IPC_PROTOCOL_H
69 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...
IPC protocol interface for calling IPC methods over sockets.
virtual void listen(mp::SocketId listen_fd, interfaces::Init &init, std::optional< size_t > max_connections=std::nullopt)=0
Listen for connections on provided socket id, accept them, and handle requests on accepted connection...
virtual void disconnectIncoming()=0
Disconnect any incoming connections that are still connected.
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.
virtual Context & context()=0
Context accessor.
virtual void serve(interfaces::Init &init, const std::function< mp::Stream()> &make_stream)=0
Handle requests from a stream provided by the make_stream callback, forwarding them to the provided I...
virtual std::unique_ptr< interfaces::Init > connect(mp::Stream stream)=0
Return Init interface that forwards requests over given connection stream.
virtual ~Protocol()=default
virtual mp::Stream makeStream(mp::SocketId socket)=0
Make stream object from socket id.
kj::Own< kj::AsyncIoStream > Stream
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.