Wiki

Clone wiki

Rug.Osc / Sending a message

Sending messages with Rug.Osc is very simple, once the sender has been constructed and connected you can send messages with a single line. All sending is handled asynchronously behind the scenes.

#!c#
class Program
{
    static void Main(string[] args)
    {
        // This is the ip address we are going to send to
        IPAddress address = IPAddress.Parse("127.0.0.1");

        // This is the port we are going to send to 
        int port = 12345;

        // Create a new sender instance
        using (OscSender sender = new OscSender(address, port))
        {
            // Connect the sender socket  
            sender.Connect();

            // Send a new message
            sender.Send(new OscMessage("/test", 1, 2, 3, 4));
        }
    }
}

Updated