From c567ae66c6b19a096b4a067dca3e20857aacf1dd Mon Sep 17 00:00:00 2001 From: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Date: Sun, 19 Apr 2026 01:04:43 -0700 Subject: [PATCH] feat(streaming_client): add --rpc-port flag to ola_streaming_client Closes #1994 for the streaming-client tool. The RPC port has been tuneable on olad via -r/--rpc_port since forever (olad/OlaServer.cpp:66); this exposes the same knob on ola_streaming_client so users can point the CLI at a non-default olad instance without needing to edit config. The underlying StreamingClient::Options.server_port field already exists (ola/StreamingClient.cpp:48,58) and flows through to ConnectToServer(m_server_port). This PR only surfaces it via the CLI: - New DEFINE_s_uint16(rpc_port, r, ola::OLA_DEFAULT_PORT, ...) matching olad's flag name, short form, and default (9010 from include/ola/Constants.h:68). - Existing 'StreamingClient ola_client;' replaced with an Options construction that carries FLAGS_rpc_port. ola_dmxmonitor and ola_dmxconsole use OlaClientWrapper, which does not yet carry a server_port knob. Extending the wrapper is a separate change; this PR is intentionally scoped to the one tool where the library already supports the option. --- examples/ola-streaming-client.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/ola-streaming-client.cpp b/examples/ola-streaming-client.cpp index bb645bd509..20c2a89464 100644 --- a/examples/ola-streaming-client.cpp +++ b/examples/ola-streaming-client.cpp @@ -19,6 +19,7 @@ */ #include +#include #include #include #include @@ -47,6 +48,8 @@ DEFINE_s_default_bool(universe_from_stdin, s, false, "when reading DMX data from STDIN. The universe number " "must precede the channel values, and be delimited by " "whitespace, e.g. 1 0,255,128 2 0,255,127"); +DEFINE_s_uint16(rpc_port, r, ola::OLA_DEFAULT_PORT, + "The RPC port olad is listening on."); bool terminate = false; @@ -76,7 +79,9 @@ int main(int argc, char *argv[]) { "Send DMX512 data to OLA. If DMX512 data isn't provided, it " "will read from STDIN."); - StreamingClient ola_client; + StreamingClient::Options options; + options.server_port = FLAGS_rpc_port; + StreamingClient ola_client(options); if (!ola_client.Setup()) { OLA_FATAL << "Setup failed"; exit(ola::EXIT_SOFTWARE);