From 6dfa490bedf33afe2131fc655cbfb6e263b211b0 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Wed, 16 Sep 2026 11:53:17 -0700 Subject: [PATCH] ioc: set PVAS_SERVER_PORT Publish TCP port used by IOC singleton server for consumption by recsync. --- documentation/releasenotes.rst | 1 + ioc/iochooks.cpp | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/documentation/releasenotes.rst b/documentation/releasenotes.rst index 905c776..9f8e13b 100644 --- a/documentation/releasenotes.rst +++ b/documentation/releasenotes.rst @@ -16,6 +16,7 @@ Release Notes enough for a channel to be considered "claimed". It is necessary to set some GET/RPC/MONITOR/... handler. - ioc: serve ``display.precision`` for boRecord.HIGH and mbbxDirect (Sang Woo Kim) +- ioc: publish ``$PVAS_SERVER_PORT`` and ``$PVXS_SERVER_PORT`` with the IOC singleton server's TCP port. - tools: The CLI tools are now built only with epics-base >= 3.15 . - tools: pvxput now understand JSON syntax. - tools: CLI tool argument parsing now requires that option flags appear before positional arguments. diff --git a/ioc/iochooks.cpp b/ioc/iochooks.cpp index ae0455d..6e35893 100644 --- a/ioc/iochooks.cpp +++ b/ioc/iochooks.cpp @@ -16,6 +16,9 @@ #include #include +#include + +#include #include #include #include @@ -93,6 +96,14 @@ void initialisePvxsServer() { Guard G(pvxServer->lock); if(!pvxServer->srv) { pvxServer->srv = Server(conf); + + std::ostringstream strm; + std::string portstr(SB()<srv.config().tcp_port); + // publish our effective TCP port number + epicsEnvSet("PVXS_SERVER_PORT", portstr.c_str()); + // publish with the same name used by pvAccessCPP, + // which may later overwrite if it is also loaded. + epicsEnvSet("PVAS_SERVER_PORT", portstr.c_str()); } }