9#ifndef LIBE3_ZMQ_CONNECTOR_HPP
10#define LIBE3_ZMQ_CONNECTOR_HPP
32 uint16_t inbound_port,
33 uint16_t outbound_port,
43 int receive(std::vector<uint8_t>& buffer)
override;
62 return transport_layer_;
73 uint16_t inbound_port_;
74 uint16_t outbound_port_;
76 void* context_{
nullptr};
77 void* setup_socket_{
nullptr};
78 void* inbound_socket_{
nullptr};
79 void* outbound_socket_{
nullptr};
81 bool connected_{
false};
87 std::atomic<bool> shutdown_requested_{
false};
89 void setup_ipc_permissions(
const std::string& path);
90 bool reset_setup_socket();
const std::string & inbound_endpoint() const noexcept
Get inbound endpoint.
const std::string & setup_endpoint() const noexcept
Get setup endpoint.
const std::string & outbound_endpoint() const noexcept
Get outbound endpoint.
E3Connector(const E3Connector &)=delete
ErrorCode setup_outbound_connection_client() override
Connect the outbound channel (dApp role: PUB connect to the RAN's subscriber endpoint).
E3LinkLayer link_layer() const noexcept override
Get the link layer type.
ErrorCode send_setup_request_client(const std::vector< uint8_t > &data) override
Send a SetupRequest on the setup channel (dApp role).
E3TransportLayer transport_layer() const noexcept override
Get the transport layer type.
ErrorCode setup_initial_connection() override
Set up the initial connection (setup channel).
ErrorCode setup_initial_connection_client() override
Connect the setup channel (dApp role: REQ connect).
void dispose() override
Clean up and release all resources.
~ZmqE3Connector() override
int recv_setup_request(std::vector< uint8_t > &buffer) override
Receive a setup request.
ZmqE3Connector(E3TransportLayer transport_layer, const std::string &setup_endpoint, const std::string &inbound_endpoint, const std::string &outbound_endpoint, uint16_t setup_port, uint16_t inbound_port, uint16_t outbound_port, size_t io_threads)
int receive(std::vector< uint8_t > &buffer) override
Receive data from the inbound channel.
ErrorCode setup_inbound_connection_client() override
Connect the inbound channel (dApp role: SUB connect to the RAN's publisher endpoint).
ErrorCode setup_inbound_connection() override
Set up the inbound connection (SUB channel).
ErrorCode send_response(const std::vector< uint8_t > &data) override
Send a setup response.
ErrorCode send(const std::vector< uint8_t > &data) override
Send data on the outbound channel.
ErrorCode setup_outbound_connection() override
Set up the outbound connection (PUB channel).
int recv_setup_response_client(std::vector< uint8_t > &buffer) override
Receive a SetupResponse on the setup channel (dApp role).
void shutdown() override
Interrupt blocking operations for shutdown.
bool is_connected() const noexcept override
Check if connector is connected.
Abstract E3 Connector interface for transport layer.
ErrorCode
Error codes returned by libe3 operations Use shared error-code list (see libe3/error_codes....
E3TransportLayer
Transport layer types (matches Python E3TransportLayer).
E3LinkLayer
Link layer types (matches Python E3LinkLayer).
@ ZMQ
ZeroMQ-based transport.