lookup_ring(timeout=5, &block)
public
Looks up RingServers waiting timeout seconds. RingServers will be
given block as a callback, which will be called with the remote TupleSpace.
# File lib/rinda/ring.rb, line 176
def lookup_ring(timeout=5, &block)
return lookup_ring_any(timeout) unless block_given?
msg = Marshal.dump([[:lookup_ring, DRbObject.new(block)], timeout])
@broadcast_list.each do |it|
soc = UDPSocket.open
begin
soc.setsockopt(Socket::SOL_SOCKET, Socket::SO_BROADCAST, true)
soc.send(msg, 0, it, @port)
rescue
nil
ensure
soc.close
end
end
sleep(timeout)
end