aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/config/config.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2026-03-13 09:24:59 +0100
committerGitHub Enterprise <[email protected]>2026-03-13 09:24:59 +0100
commitef586f5930ac761f8e8e18cde2ebd5248efeaa4a (patch)
treebe6c7d3e11f9261c1d03d646bc579ac0d27452d7 /src/zenserver/config/config.cpp
parentSwitch httpclient default back-end over to libcurl (#832) (diff)
downloadzen-ef586f5930ac761f8e8e18cde2ebd5248efeaa4a.tar.xz
zen-ef586f5930ac761f8e8e18cde2ebd5248efeaa4a.zip
Unix Domain Socket auto discovery (#833)
This PR adds end-to-end Unix domain socket (UDS) support, allowing zen CLI to discover and connect to UDS-only servers automatically. - **`unix://` URI scheme in zen CLI**: The `-u` / `--hosturl` option now accepts `unix:///path/to/socket` to connect to a zenserver via a Unix domain socket instead of TCP. - **Per-instance shared memory for extended server info**: Each zenserver instance now publishes a small shared memory section (keyed by SessionId) containing per-instance data that doesn't fit in the fixed-size ZenServerEntry -- starting with the UDS socket path. This is a 4KB pagefile-backed section on Windows (`Global\ZenInstance_{sessionid}`) and a POSIX shared memory object on Linux/Mac (`/UnrealEngineZen_{sessionid}`). - **Client-side auto-discovery of UDS servers**: `zen info`, `zen status`, etc. now automatically discover and prefer UDS connections when a server publishes a socket path. Servers running with `--no-network` (UDS-only) are no longer invisible to the CLI. - **`kNoNetwork` flag in ZenServerEntry**: Servers started with `--no-network` advertise this in their shared state entry. Clients skip TCP fallback for these servers, and display commands (`ps`, `status`, `top`) show `-` instead of a port number to indicate TCP is not available.
Diffstat (limited to 'src/zenserver/config/config.cpp')
-rw-r--r--src/zenserver/config/config.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/zenserver/config/config.cpp b/src/zenserver/config/config.cpp
index 8118cb424..60ae93853 100644
--- a/src/zenserver/config/config.cpp
+++ b/src/zenserver/config/config.cpp
@@ -201,6 +201,7 @@ struct ZenServerCmdLineOptions
std::string DataDir;
std::string BaseSnapshotDir;
std::string SecurityConfigPath;
+ std::string UnixSocketPath;
std::string PortStr;
ZenLoggingCmdLineOptions LoggingOptions;
@@ -320,7 +321,7 @@ ZenServerCmdLineOptions::AddCliOptions(cxxopts::Options& options, ZenServerConfi
"",
"unix-socket",
"Unix domain socket path to listen on (in addition to TCP)",
- cxxopts::value<std::string>(ServerOptions.HttpConfig.UnixSocketPath),
+ cxxopts::value<std::string>(UnixSocketPath),
"<path>");
options.add_option("network",
@@ -480,6 +481,11 @@ ZenServerCmdLineOptions::ApplyOptions(cxxopts::Options& options, ZenServerConfig
ServerOptions.BaseSnapshotDir = MakeSafeAbsolutePath(BaseSnapshotDir);
ServerOptions.SecurityConfigPath = MakeSafeAbsolutePath(SecurityConfigPath);
+ if (!UnixSocketPath.empty())
+ {
+ ServerOptions.HttpConfig.UnixSocketPath = MakeSafeAbsolutePath(UnixSocketPath);
+ }
+
if (PortStr != "auto")
{
int Port = 0;