A RingServer allows a Rinda::TupleSpace to be located via UDP broadcasts. Service location uses the following steps:
A RingServer begins listening on the broadcast UDP address.
A RingFinger sends a UDP packet containing the DRb URI where it will listen for a reply.
The RingServer receives the UDP packet and connects back to the provided DRb URI with the DRb service.
ts on the UDP broadcast address at
# File lib/rinda/ring.rb, line 32 def initialize(ts, port=Ring_PORT) @ts = ts @soc = UDPSocket.open @soc.bind('', port) @w_service = write_service @r_service = reply_service end
Creates a thread that notifies waiting clients from the TupleSpace.
# File lib/rinda/ring.rb, line 70 def reply_service Thread.new do loop do do_reply end end end
Creates a thread that picks up UDP packets and passes them to #do_write for decoding.
# File lib/rinda/ring.rb, line 44 def write_service Thread.new do loop do msg = @soc.recv(1024) do_write(msg) end end end