From: Massimiliano Mirra Date: 2001-11-26T05:31:22+09:00 Subject: [ruby-talk:26468] Re: DRb and failing test, please give some insight... On Sun, Nov 25, 2001 at 01:16:04PM +0900, Massimiliano Mirra wrote: > I am familiarizing with DRb. I managed to put to work a tiny c/s [...] Apparently I didn't strip all I could strip from the previous example. This is the bare bones of the problem: the last line returns false instead of the expected true. Am I misunderstanding something basic about the way DRb works? Maybe passing ``self'' in Client.login does not really pass a reference to self, so it does not match when it is later compared in Client.online? ? Massimiliano #!/usr/bin/env ruby require 'drb' class Client include DRbUndumped def initialize(server_uri) DRb.start_service @server = DRbObject.new(nil, server_uri) end def login @server.register(self) end def online? @server.online?(self) end end class Server def initialize @users = [] end def register(user) @users.push user unless @users.include?(user) end def online?(user) @users.include?(user) end end DRb.start_service(nil, Server.new) client = Client.new(DRb.uri) client.login puts client.online? == true