MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
Address.hpp
Go to the documentation of this file.
1#pragma once
2
3namespace Lila {
4
5/**
6 * @struct TcpAddress
7 * @brief A TCP host and port.
8 *
9 * The host is loopback by default, so only this machine can connect. Use
10 * "0.0.0.0" to accept other machines. There is no authentication: anyone who
11 * can connect can run code.
12 */
13struct TcpAddress {
14 std::string host { "127.0.0.1" };
15 int port { 9090 };
16};
17
18/**
19 * @struct UnixAddress
20 * @brief A Unix domain socket: a socket file that only its owner can use.
21 *
22 * path is where the socket file goes. When empty, the default socket in the
23 * user's runtime directory is used.
24 */
26 std::optional<std::filesystem::path> path;
27};
28
29/**
30 * @brief Where a Lila listens. A Lila listens at one address at most.
31 */
32using Address = std::variant<TcpAddress, UnixAddress>;
33
34} // namespace Lila
std::variant< TcpAddress, UnixAddress > Address
Where a Lila listens.
Definition Address.hpp:32
std::string host
Definition Address.hpp:14
A TCP host and port.
Definition Address.hpp:13
std::optional< std::filesystem::path > path
Definition Address.hpp:26
A Unix domain socket: a socket file that only its owner can use.
Definition Address.hpp:25