Class: OSC::UDPServer

Inherits:
UDPSocket show all
Includes:
Server
Defined in:
lib/osc/udp.rb

Constant Summary collapse

MAX_MSG_SIZE =
32768

Instance Method Summary collapse

Methods included from Server

#add_method, #dispatch, #dispatch_bundle

Methods included from Transport

#recv, #recvfrom, #send, #send_timestamped

Instance Method Details

#reply(msg1, msg2) ⇒ Object

send msg2 as a reply to msg1



25
26
27
28
# File 'lib/osc/udp.rb', line 25

def reply(msg1, msg2)
  domain, port, host, ip = msg2.source
  send(msg2, 0, host, port)
end

#serveObject



17
18
19
20
21
22
# File 'lib/osc/udp.rb', line 17

def serve
  loop do
    p, sender = recvfrom(MAX_MSG_SIZE)
    dispatch p
  end
end