|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
Abstract interface for IPC client. More...
#include <ipc_client.hpp>
Public Member Functions | |
| IpcClient ()=default | |
| virtual | ~IpcClient ()=default |
| IpcClient (const IpcClient &)=delete | |
| IpcClient & | operator= (const IpcClient &)=delete |
| IpcClient (IpcClient &&)=delete | |
| IpcClient & | operator= (IpcClient &&)=delete |
| virtual bool | connect ()=0 |
| Connect to the server. | |
| virtual bool | send (const void *data, size_t len, uint64_t timeout_ns)=0 |
| Send a message to the server. | |
| virtual std::span< const uint8_t > | receive (uint64_t timeout_ns)=0 |
| Receive a message from the server (zero-copy for shared memory) | |
| virtual void | release (size_t message_size)=0 |
| Release the previously received message. | |
| virtual void | close ()=0 |
| Close the connection. | |
Static Public Member Functions | |
| static std::unique_ptr< IpcClient > | create_socket (const std::string &socket_path) |
| static std::unique_ptr< IpcClient > | create_shm (const std::string &base_name) |
Abstract interface for IPC client.
Provides a unified interface for connecting to IPC servers and exchanging messages. Implementations handle transport-specific details (Unix domain sockets, shared memory, etc).
Definition at line 18 of file ipc_client.hpp.
|
default |
|
virtualdefault |
|
delete |
|
delete |
|
pure virtual |
Close the connection.
Implemented in bb::ipc::ShmClient, and bb::ipc::SocketClient.
|
pure virtual |
Connect to the server.
Implemented in bb::ipc::ShmClient, and bb::ipc::SocketClient.
|
static |
Definition at line 15 of file ipc_client.cpp.
|
static |
Definition at line 10 of file ipc_client.cpp.
|
pure virtual |
Receive a message from the server (zero-copy for shared memory)
| timeout_ns | Timeout in nanoseconds |
The span remains valid until release() is called or the next recv(). For shared memory: direct view into ring buffer (true zero-copy) For sockets: view into internal buffer (eliminates one copy)
Must be followed by release() to consume the message.
Implemented in bb::ipc::ShmClient, and bb::ipc::SocketClient.
|
pure virtual |
Release the previously received message.
| message_size | Size of the message being released (from span.size()) |
Must be called after recv() to consume the message and free resources. For shared memory: releases space in the ring buffer For sockets: no-op (message already consumed during recv)
Implemented in bb::ipc::ShmClient, and bb::ipc::SocketClient.
|
pure virtual |
Send a message to the server.
| data | Pointer to message data |
| len | Length of message in bytes |
| timeout_ns | Timeout in nanoseconds (0 = infinite) |
Implemented in bb::ipc::ShmClient, and bb::ipc::SocketClient.