Skip to content

Commit

Permalink
ofxOscSender.setup() fix (#6287)
Browse files Browse the repository at this point in the history
as mentioned here: https://forum.openframeworks.cc/t/ofxoscsender-falls-back-on-localhost/32442/2
and discussed there: bltzr/openFrameworks@93ccf31 with @danomatika

when providing an unavailable host to ofxOscSender.setup() it was falling back to localhost, which prevented from knowing that the connection to the desired host failed.

those 2 commits fix that, and post an error message when the endpoint cannot be reached

#changelog #addons #ofxOsc
  • Loading branch information
Pascal Baltazar authored and arturoc committed Jun 17, 2019
1 parent cf6cc8d commit 8e70657
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions addons/ofxOsc/src/ofxOscSender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ bool ofxOscSender::setup(const ofxOscSenderSettings &settings){
osc::UdpTransmitSocket *socket = nullptr;
try{
osc::IpEndpointName name = osc::IpEndpointName(settings.host.c_str(), settings.port);
if (!name.address){
ofLogError("ofxOscSender") << "bad host? " << settings.host;
return false;
}
socket = new osc::UdpTransmitSocket(name, settings.broadcast);
sendSocket.reset(socket);
}
Expand Down

0 comments on commit 8e70657

Please sign in to comment.