An OSC message sender.
An OSCSender object can connect to a network port. It then can send OSC messages and bundles to a specified host over an UDP socket.
Public Member Functions | |
| OSCSender () | |
| Constructs a new OSCSender. | |
| ~OSCSender () | |
| Destructor. | |
| bool | connect (const String &targetHostName, int targetPortNumber) |
| Connects to a datagram socket and prepares the socket for sending OSC packets to the specified target. | |
| bool | connectToSocket (DatagramSocket &socket, const String &targetHostName, int targetPortNumber) |
| Uses an existing datagram socket for sending OSC packets to the specified target. | |
| bool | disconnect () |
| Disconnects from the currently used UDP port. | |
| bool | send (const OSCMessage &message) |
| Sends an OSC message to the target. | |
| bool | send (const OSCBundle &bundle) |
| Send an OSC bundle to the target. | |
| bool | sendToIPAddress (const String &targetIPAddress, int targetPortNumber, const OSCMessage &message) |
| Sends an OSC message to a specific IP address and port. | |
| bool | sendToIPAddress (const String &targetIPAddress, int targetPortNumber, const OSCBundle &bundle) |
| Sends an OSC bundle to a specific IP address and port. | |
| template<typename... Args> | |
| bool | send (const OSCAddressPattern &address, Args &&... args) |
| Creates a new OSC message with the specified address pattern and list of arguments, and sends it to the target. | |
| template<typename... Args> | |
| bool | sendToIPAddress (const String &targetIPAddress, int targetPortNumber, const OSCAddressPattern &address, Args &&... args) |
| Creates a new OSC message with the specified address pattern and list of arguments, and sends it to the target. | |
| juce::OSCSender::OSCSender | ( | ) |
Constructs a new OSCSender.
Referenced by sendToIPAddress().
| juce::OSCSender::~OSCSender | ( | ) |
Destructor.
| bool juce::OSCSender::connect | ( | const String & | targetHostName, |
| int | targetPortNumber ) |
Connects to a datagram socket and prepares the socket for sending OSC packets to the specified target.
Note: The operating system will choose which specific network adapter(s) to bind your socket to, and which local port to use for the sender.
| targetHostName | The remote host to which messages will be send. |
| targetPortNumber | The remote UDP port number on which the host will receive the messages. |
| bool juce::OSCSender::connectToSocket | ( | DatagramSocket & | socket, |
| const String & | targetHostName, | ||
| int | targetPortNumber ) |
Uses an existing datagram socket for sending OSC packets to the specified target.
| socket | An existing datagram socket. Make sure this doesn't get deleted while this class is still using it! |
| targetHostName | The remote host to which messages will be send. |
| targetPortNumber | The remote UDP port number on which the host will receive the messages. |
| bool juce::OSCSender::disconnect | ( | ) |
Disconnects from the currently used UDP port.
| bool juce::OSCSender::send | ( | const OSCMessage & | message | ) |
Sends an OSC message to the target.
| message | The OSC message to send. |
Referenced by send(), and sendToIPAddress().
| bool juce::OSCSender::send | ( | const OSCBundle & | bundle | ) |
Send an OSC bundle to the target.
| bundle | The OSC bundle to send. |
| bool juce::OSCSender::sendToIPAddress | ( | const String & | targetIPAddress, |
| int | targetPortNumber, | ||
| const OSCMessage & | message ) |
Sends an OSC message to a specific IP address and port.
This overrides the address and port that was originally set for this sender.
| targetIPAddress | The IP address to send to |
| targetPortNumber | The target port number |
| message | The OSC message to send. |
Referenced by sendToIPAddress(), and sendToIPAddress().
| bool juce::OSCSender::sendToIPAddress | ( | const String & | targetIPAddress, |
| int | targetPortNumber, | ||
| const OSCBundle & | bundle ) |
Sends an OSC bundle to a specific IP address and port.
This overrides the address and port that was originally set for this sender.
| targetIPAddress | The IP address to send to |
| targetPortNumber | The target port number |
| bundle | The OSC bundle to send. |
References OSCSender(), send(), and sendToIPAddress().
| bool juce::OSCSender::send | ( | const OSCAddressPattern & | address, |
| Args &&... | args ) |
Creates a new OSC message with the specified address pattern and list of arguments, and sends it to the target.
| address | The OSC address pattern of the message (you can use a string literal here). |
| args | The list of arguments for the message. |
References send().
| bool juce::OSCSender::sendToIPAddress | ( | const String & | targetIPAddress, |
| int | targetPortNumber, | ||
| const OSCAddressPattern & | address, | ||
| Args &&... | args ) |
Creates a new OSC message with the specified address pattern and list of arguments, and sends it to the target.
| targetIPAddress | The IP address to send to |
| targetPortNumber | The target port number |
| address | The OSC address pattern of the message (you can use a string literal here). |
| args | The list of arguments for the message. |
References sendToIPAddress().