Rinda not working through the network - what's wrong?

  • Thread starter Pau Garcia i Quiles
  • Start date
P

Pau Garcia i Quiles

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

I have host A (IP 192.168.1.3) and host B (IP 192.168.1.5), both of them Linux
(KUbuntu 5.10) with no firewall. I am running ruby 1.8.4, installed from
KUbuntu packages.

If I run ringserver.rb, server.rb and client.rb in the same host, it works
fine. (Source code is at the end of the message)

But if I go for the interesting case, i. e. running ringserver.rb (taken
straight from segment7.net) and server.rb in host A and client.rb in host B,
it fails with a RingNotFound exception.

What am I doing wrong? Should I specify a port for Rinda? (I think the
broadcast list should be enough)

=== ringserver.rb ===
#!/usr/bin/env ruby -w
#
# Start this one first.
#
# ringserver.rb
# Rinda RingServer

require 'rinda/ring'
require 'rinda/tuplespace'

# start DRb
DRb.start_service

# Create a TupleSpace to hold named services, and start running
Rinda::RingServer.new Rinda::TupleSpace.new

# Wait until the user explicitly kills the server.
DRb.thread.join
==============


=== server.rb ===
#!/usr/bin/env ruby -w
#
require 'drb'
require 'rinda/ring'

class TestServer
include DRbUndumped
def add(*args)
args.inject{ |n,v| n + v }
end
end

server = TestServer.new
DRb.start_service('druby://:9000', server)

provider = Rinda::RingProvider.new :TestServer, server, "Test Server"
provider.provide

DRb.thread.join

==============

=== client.rb ===
#!/usr/bin/env ruby -w
#
require 'drb'
require 'rinda/ring'

DRb.start_service()

ringfinger = Rinda::RingFinger.new(['192.168.1.3','192.168.1.5'])
@ringserver = ringfinger.lookup_ring_any()

obj_tuple = @ringserver.take([:name, nil, nil, nil])
obj = obj_tuple[2]

puts "Sum is: #{obj.add(1,2,3,4)}"
==============


Thank you.



- --
Pau Garcia i Quiles
http://www.elpauer.org
(Due to the amount of work, I usually need 10 days to answer)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFEFLOB/DzYv9iGJzsRAjdgAJ48uL8URkW33PFZ9s7UrLLNmz3EiwCg1hrk
whtbE+nK9+q/Zxz33GtRdvw=
=m1YQ
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,968
Messages
2,570,150
Members
46,696
Latest member
BarbraOLog

Latest Threads

Top