Skip to content

Commit 04ce6a3

Browse files
authored
Osc swap (#7600)
#changelog #addon
1 parent 6add96b commit 04ce6a3

2 files changed

Lines changed: 19 additions & 10 deletions

File tree

addons/ofxOsc/src/ofxOscReceiver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ ofxOscReceiver& ofxOscReceiver::copy(const ofxOscReceiver &other){
2828
}
2929

3030
//--------------------------------------------------------------
31-
bool ofxOscReceiver::setup(int port, std::string host) {
31+
bool ofxOscReceiver::setup(std::string host, int port) {
3232
if(listenSocket){ // already running
3333
stop();
3434
}

addons/ofxOsc/src/ofxOscReceiver.h

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,24 @@ class ofxOscReceiver : public osc::OscPacketListener {
3131
/// for operator= and copy constructor
3232
ofxOscReceiver& copy(const ofxOscReceiver &other);
3333

34-
/// set up the receiver with the port (and specific host/ip) to listen for messages on
35-
/// and start listening
36-
///
37-
/// multiple receivers can share the same port if port reuse is
38-
/// enabled (true by default)
39-
///
40-
/// \return true if listening started
41-
bool setup(int port, std::string host = "0.0.0.0");
42-
34+
/// set up the receiver to listen for messages through any hosts on the given port
35+
/// and start listening
36+
///
37+
/// multiple receivers can share the same port if port reuse is
38+
/// enabled (true by default)
39+
///
40+
/// \return true if listening started
41+
bool setup(int port) { return setup( "0.0.0.0", port); }
42+
43+
/// set up the receiver to listen for messages on the specific host/ip
44+
/// and start listening
45+
///
46+
/// multiple receivers can share the same port if port reuse is
47+
/// enabled (true by default)
48+
///
49+
/// \return true if listening started
50+
bool setup(std::string host, int port);
51+
4352
/// set up the receiver with the given settings
4453
///
4554
/// starts listening if start is true (true by default)

0 commit comments

Comments
 (0)