aberant/osc-ruby — pull request #7 by samaaron (2013-07-04 22:25:46+00:00)
Title: Teach server how to act as a client

This essentially allows the server to act as a client. This is extremely
useful in the situations where you wish to send a message to an external
OSC server and then listen to responses from it (which it sends back
down the UDPSocket).

For example, when communicating with the SuperCollider server, it's
useful to send the "/notify" command, which then allows you to receive
information from the server.

server = OSC::Server.new 5440

server.add_method "/done" do |m|
puts "done!"
end

Thread.new {server.run}

scsynth_port = 6555
server.send(OSC::Message.new("/notify", 1).encode, "127.0.0.1", scsynth_port))