OSCSender::sendToIPAddress


#1

Hi, I would have thought these would be static methods as it seems strange to have to open the connection first? If I’ve specified the host and IP address in the connect call then I don’t need to specify them in these calls, unless the purpose of these calls is to change the IP address on a connection and then call only send() afterwards?


#2

The reason it’s not static is that sending UDP messages still requires a socket to be bound to a specific port and address - this is the port the receiver of the OSC message will see when it inspects where the message came from.

The OS needs to reserve this port and address and most OSes do not allow you to immediately re-use ports due to security reasons. Therefore it makes sense to bind this socket once (let’s say at app launch) and reserve the port/address for the app’s lifetime.

Some other OSC implementations bind to random ports every time you send a packet. In this case sendToIPAddress could be static. But we want to give you more flexibility.


#3

hi… thx for the explanation… cheers