From 4a54041721892de7ed7f773ef36189d5bcf00898 Mon Sep 17 00:00:00 2001 From: alexandre burton Date: Fri, 18 Aug 2023 11:12:51 -0400 Subject: [PATCH 1/2] ofxOscReceiver: swap setup() (vs new host arg) --- addons/ofxOsc/src/ofxOscReceiver.cpp | 2 +- addons/ofxOsc/src/ofxOscReceiver.h | 27 ++++++++++++++++++--------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/addons/ofxOsc/src/ofxOscReceiver.cpp b/addons/ofxOsc/src/ofxOscReceiver.cpp index fbf291605f0..38aa1b4e8c5 100644 --- a/addons/ofxOsc/src/ofxOscReceiver.cpp +++ b/addons/ofxOsc/src/ofxOscReceiver.cpp @@ -28,7 +28,7 @@ ofxOscReceiver& ofxOscReceiver::copy(const ofxOscReceiver &other){ } //-------------------------------------------------------------- -bool ofxOscReceiver::setup(int port, std::string host) { +bool ofxOscReceiver::setup(std::string host, int port) { if(listenSocket){ // already running stop(); } diff --git a/addons/ofxOsc/src/ofxOscReceiver.h b/addons/ofxOsc/src/ofxOscReceiver.h index 83c3ff8d619..3fc0e2b6278 100644 --- a/addons/ofxOsc/src/ofxOscReceiver.h +++ b/addons/ofxOsc/src/ofxOscReceiver.h @@ -31,15 +31,24 @@ class ofxOscReceiver : public osc::OscPacketListener { /// for operator= and copy constructor ofxOscReceiver& copy(const ofxOscReceiver &other); - /// set up the receiver with the port (and specific host/ip) to listen for messages on - /// and start listening - /// - /// multiple receivers can share the same port if port reuse is - /// enabled (true by default) - /// - /// \return true if listening started - bool setup(int port, std::string host = "0.0.0.0"); - + /// set up the receiver with the port to listen for messages through any interface on the given port + /// and start listening + /// + /// multiple receivers can share the same port if port reuse is + /// enabled (true by default) + /// + /// \return true if listening started + bool setup(int port) { return setup( "0.0.0.0", port); } + + /// set up the receiver with the specific host/ip to listen for messages on + /// and start listening + /// + /// multiple receivers can share the same port if port reuse is + /// enabled (true by default) + /// + /// \return true if listening started + bool setup(std::string host, int port); + /// set up the receiver with the given settings /// /// starts listening if start is true (true by default) From 6b9afdb14dbea4b2ce9de4b13079194ed109b6f7 Mon Sep 17 00:00:00 2001 From: alexandre burton Date: Fri, 18 Aug 2023 11:16:36 -0400 Subject: [PATCH 2/2] ofxOscReceiver: setup docs tweaks --- addons/ofxOsc/src/ofxOscReceiver.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/ofxOsc/src/ofxOscReceiver.h b/addons/ofxOsc/src/ofxOscReceiver.h index 3fc0e2b6278..d3d906303d4 100644 --- a/addons/ofxOsc/src/ofxOscReceiver.h +++ b/addons/ofxOsc/src/ofxOscReceiver.h @@ -31,7 +31,7 @@ class ofxOscReceiver : public osc::OscPacketListener { /// for operator= and copy constructor ofxOscReceiver& copy(const ofxOscReceiver &other); - /// set up the receiver with the port to listen for messages through any interface on the given port + /// set up the receiver to listen for messages through any hosts on the given port /// and start listening /// /// multiple receivers can share the same port if port reuse is @@ -40,7 +40,7 @@ class ofxOscReceiver : public osc::OscPacketListener { /// \return true if listening started bool setup(int port) { return setup( "0.0.0.0", port); } - /// set up the receiver with the specific host/ip to listen for messages on + /// set up the receiver to listen for messages on the specific host/ip /// and start listening /// /// multiple receivers can share the same port if port reuse is