NPRPC docs

class EndPoint

C++

class EndPoint

A transport plus an address: host and port, or a shared-memory channel id. One entry of ObjectId::urls(), parsed.

include/nprpc/endpoint.hpp:24

Constructors

EndPoint() = default

An empty endpoint.

include/nprpc/endpoint.hpp:113

EndPoint(EndPointType type, std::string_view hostname, std::uint16_t port) noexcept

An endpoint from its parts.

include/nprpc/endpoint.hpp:116

EndPoint(std::string_view url, std::optional<EndPointType> type = std::nullopt)

Parses a URL such as tcp://host:port or mem://<channel>.

web:// URLs serve several transports, so type says which one this is. Throws std::invalid_argument for an unknown scheme, a missing or malformed port, or a web:// URL without type.

include/nprpc/endpoint.hpp:128

Methods

bool empty() const noexcept

Whether no address is set.

include/nprpc/endpoint.hpp:85

std::string get_full() const noexcept

host:port without the scheme; the channel id for shared memory.

include/nprpc/endpoint.hpp:103

std::string_view hostname() const noexcept

Host name or IP address; the channel id for shared memory.

include/nprpc/endpoint.hpp:81

bool is_ssl() const noexcept

Whether the transport is encrypted with TLS (WSS, HTTPS, WebTransport).

include/nprpc/endpoint.hpp:88

std::string_view memory_channel_id() const noexcept

For shared memory endpoints, the channel id; empty otherwise.

include/nprpc/endpoint.hpp:96

std::uint16_t port() const noexcept

Port; 0 for shared memory.

include/nprpc/endpoint.hpp:83

static constexpr std::string_view to_string(EndPointType type) noexcept

The URL scheme for type, e.g. tcp://.

include/nprpc/endpoint.hpp:32

std::string to_string() const noexcept

The endpoint as a URL: tcp://host:port, or mem://<channel>.

include/nprpc/endpoint.hpp:55

EndPointType type() const noexcept

The transport.

include/nprpc/endpoint.hpp:79

Operators

bool operator!=(const EndPoint &other) const noexcept

Differs in transport, host or port.

include/nprpc/endpoint.hpp:73

bool operator==(const EndPoint &other) const noexcept

Same transport, host and port.

include/nprpc/endpoint.hpp:66