From: edwardhatfield1@... (Edward Hatfield) Date: 2002-03-01T02:18:40+09:00 Subject: DRb TupleSpace Example Poofter Hello All, I got excited about the DRb Tuplespace example in the 'Ruby Developers Guide' book, on page 331 under 'Load-Balancing'. It looked pretty cool, so I typed in in and *Poof* it blew up. I've double checked the syntax and looked at the examples that came with DRb (drb-1.3.4.2). I'm using ruby version 1.6.6, and all I can say is: 'It doesn't seem to work as advertised in the Book.' Here's the server: #!/usr/bin/ruby # file comp_s.rb require "drb" DRb.start_service ts = DRbObject.new( nil, ARGV[0] ) loop { # get a request from the TupleSpace req, a, b = ts.in( ['req', nil, nil] ) # compute the result res = a * b # to identify the server on the client side host = DRb.uri.split('//')[1].split(':')[0] # put the result back into the TupleSpace ts.out( ['res', a, b, res, host] ) } ....and Here's the client: #!/usr/bin/ruby # file: comp_c.rb require "drb" DRb.start_service ts = DRbObject.new( nil, ARGV[0] ) for a in 6..9 do for b in 3..5 do ts.out( ['req', a, b] ) end end for a in 6..9 do for b in 3..5 do _, a, b, res, host = ts.in( ['res', a, b, nil, nil] ) puts "#{a} * #{b} = #{res} (#{host})" end end *Poof* Any help, to get these examples working would be appreciated. Thanks. Edward.