Class: OSC::Client
- Inherits:
-
Object
- Object
- OSC::Client
- Defined in:
- lib/ruby-osc/client.rb
Instance Method Summary collapse
-
#initialize(port, host = "127.0.0.1") ⇒ Client
constructor
A new instance of Client.
- #send(mesg, *_args) ⇒ Object
Constructor Details
#initialize(port, host = "127.0.0.1") ⇒ Client
Returns a new instance of Client.
7 8 9 10 11 12 |
# File 'lib/ruby-osc/client.rb', line 7 def initialize(port, host = "127.0.0.1") @socket = UDPSocket.new @socket = UDPSocket.open @socket.setsockopt(Socket::SOL_SOCKET, Socket::SO_BROADCAST, true) @socket.connect host, port end |
Instance Method Details
#send(mesg, *_args) ⇒ Object
14 15 16 |
# File 'lib/ruby-osc/client.rb', line 14 def send(mesg, *_args) @socket.send mesg.encode, 0 end |