hoijui / JavaOSC

OSC content format/"protocol" library for JVM languages
http://www.illposed.com/software/javaosc.html
BSD 3-Clause "New" or "Revised" License
156 stars 43 forks source link

Broadcast ist not allowed by default #44

Closed cansik closed 4 years ago

cansik commented 4 years ago

For some operating systems it is necessary to start the JVM with a broadcast allowance flag. Basically we just have to set the broadcast flag to true in the Socket (here is the code line):

this.underlyingChannel.socket().setBroadcast(true);

This allows us to send broadcast messages on addresses like 192.168.1.255.

hoijui commented 4 years ago

Hmm... Could you not instead use underlyingChannel.setOption(StandardSocketOptions.SO_BROADCAST, true);, before supplying underlyingChannel to the OSCDatagramChannel ctor, instead?

We should have a unit test for that though!

cansik commented 4 years ago

@hoijui I've created a PR.

cansik commented 4 years ago

45 fixes this issue.