From: Shashank Date Date: 2003-01-14T12:53:16+09:00 Subject: drb question I am trying the distributed Ruby examples from PickAxe using ruby 1.7.3 (2002-11-17) [i386-mswin32] and drb-2.0b1 The simple example works as expected. But how do I stop the server gracefully? Code as follows # Server Code: drb_srvr.rb require 'drb' class TstSrvr def time_now "It is: " + Time.now().to_s end def bye(msg="") puts msg exit(1) end end srvObj = TstSrvr.new DRb.start_service("druby://EMACHINE:5555",srvObj) DRb.thread.join #-------------------------------------------- #Client Code: drb_client.rb require 'drb' STDOUT.sync = true cliObj = DRbObject.new(nil,"druby://EMACHINE:5555") 5.times { |i| puts cliObj.time_now; sleep(2); } cliObj.bye #------------------------------------------- C:\> ruby drb_srvr.rb In a different command window: C:\> ruby drb_client.rb It is: Mon Jan 13 21:35:33 Central Standard Time 2003 It is: Mon Jan 13 21:35:35 Central Standard Time 2003 It is: Mon Jan 13 21:35:37 Central Standard Time 2003 It is: Mon Jan 13 21:35:39 Central Standard Time 2003 It is: Mon Jan 13 21:35:41 Central Standard Time 2003 C:/ruby/lib/ruby/site_ruby/1.7/drb/drb.rb:104:in `load': connection closed (DRb::DRbConnError) from C:/ruby/lib/ruby/site_ruby/1.7/drb/drb.rb:149:in `recv_reply' from C:/ruby/lib/ruby/site_ruby/1.7/drb/drb.rb:291:in `recv_reply' from C:/ruby/lib/ruby/site_ruby/1.7/drb/drb.rb:471:in `send_message' from C:/ruby/lib/ruby/site_ruby/1.7/drb/drb.rb:405:in `method_missing' from C:/ruby/lib/ruby/site_ruby/1.7/drb/drb.rb:404:in `open' from C:/ruby/lib/ruby/site_ruby/1.7/drb/drb.rb:404:in `method_missing' from C:/atest/drb_client.rb:8