5 class GWIdConv < DRbIdConv
7 if Array === ref && ref[0] == :DRbObject
8 return DRbObject.new_with(ref[1], ref[2])
36 uri, ref = Marshal.load(s)
38 return ref ? DRb.to_obj(ref) : DRb.front
41 self.new_with(DRb.uri, [:DRbObject, uri, ref])
46 if Array === @ref && @ref[0] == :DRbObject
47 Marshal.dump([@ref[1], @ref[2]])
49 Marshal.dump([@uri, @ref]) # ??
52 Marshal.dump([DRb.uri, [:DRbObject, @uri, @ref]])
59 DRb.install_id_conv(DRb::GWIdConv.new)
63 s1 = DRb::DRbServer.new('drbunix:/tmp/gw_b_a', front)
64 s2 = DRb::DRbServer.new('drbunix:/tmp/gw_b_c', front)
77 def initialize(name, peer=nil)
83 puts "#{@name}: ping: #{obj.inspect}"
84 @peer.ping(self) if @peer
95 DRb.start_service("drbunix:/tmp/gw_a", obj)
97 robj = DRbObject.new_with_uri('drbunix:/tmp/gw_b_a')
108 foo = Foo.new('c', nil)
110 DRb.start_service("drbunix:/tmp/gw_c", nil)
112 robj = DRbObject.new_with_uri("drbunix:/tmp/gw_b_c")