-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
- -----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello,
I am trying to get DRb to work between two different hosts, but I am
unable
to.
I have followed the PickAxe and the introductory course in
http://segment7.net/projects/ruby/drb/introduction.html. For example,
this
code:
== server.rb ==
require ‘drb’
class TestServer
def add(*args)
args.inject{ |n,v| n + v }
end
end
server = TestServer.new
DRb.start_service(‘druby://localhost:9000’, server)
DRb.thread.join
== client.rb ==
require ‘drb’
DRb.start_service()
obj = DRbObject.new(nil, ‘druby://localhost:9000’)
puts “Sum is: #{obj.add(1,2,3)}”
It works fine if I start both the client and the server in the same
computer,
but if I start the server in host A and the client in host B (replacing
druby://localhost:9000 with druby://hostA:9000), it does not work.
Host A and host B are able to ping each other, they do not have any
firewall
installed and host A’s IP and host B’s IP are both resolvable (via hosts
file) in both machines. I have also tried using the IP instead of host
A’s
name.
Any tip? Do I need to make the server observable or something like?
Thank you.
Pau Garcia i Quiles
http://www.elpauer.org
(En general no puedo contestar antes de 10 días)
- -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
iD8DBQFD1rHQ/DzYv9iGJzsRAny+AKCSx6BPakSmMKxttbzNHhmi3Z4BdwCgqSgl
uhEWuGALF28qLPq33VzjPiM=
=iJtE
- -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
iD8DBQFD1rHv/DzYv9iGJzsRAvIHAJ90H4tAwbMRF0UlAx4fIXjVdCL/CgCfckKa
R1GwRVxK9K2m0gBoLXaR1xQ=
=raUY
-----END PGP SIGNATURE-----