Skip to content

Commit c567ae6

Browse files
committed
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.
1 parent c6196f7 commit c567ae6

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

examples/ola-streaming-client.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
*/
2020

2121
#include <stdlib.h>
22+
#include <ola/Constants.h>
2223
#include <ola/DmxBuffer.h>
2324
#include <ola/Logging.h>
2425
#include <ola/client/StreamingClient.h>
@@ -47,6 +48,8 @@ DEFINE_s_default_bool(universe_from_stdin, s, false,
4748
"when reading DMX data from STDIN. The universe number "
4849
"must precede the channel values, and be delimited by "
4950
"whitespace, e.g. 1 0,255,128 2 0,255,127");
51+
DEFINE_s_uint16(rpc_port, r, ola::OLA_DEFAULT_PORT,
52+
"The RPC port olad is listening on.");
5053

5154
bool terminate = false;
5255

@@ -76,7 +79,9 @@ int main(int argc, char *argv[]) {
7679
"Send DMX512 data to OLA. If DMX512 data isn't provided, it "
7780
"will read from STDIN.");
7881

79-
StreamingClient ola_client;
82+
StreamingClient::Options options;
83+
options.server_port = FLAGS_rpc_port;
84+
StreamingClient ola_client(options);
8085
if (!ola_client.Setup()) {
8186
OLA_FATAL << "Setup failed";
8287
exit(ola::EXIT_SOFTWARE);

0 commit comments

Comments
 (0)