B
Benoit Daloze
[Note: parts of this message were removed to make it a legal post.]
Hi,
I found a feature that seem to be missing to me in DRb.
I'm just creating a chat with a client and a server, using only DRb to
interact between them.
My problem is I didn't found a nice way to verify if a client is alive.
I would like to be able to update my clients' list, but I need to know if
they are alive.
Currently, I'm getting around with catching the Exception DRb:RbConnError,
but that looks really ugly:
@clients.each { |c|
begin
c.respond_to?some_method_defined_in_client) #Trying to use any method
of c will raise the exception (except if not defined)
rescue DRb:RbConnError
@clients.delete(c)
end
}
Using Exceptions would be meaningful when I try to send(it would raise the
exception if I call #send), but then I would have to manage Exceptions
everywhere.
The method alive? is defined for the DRbServer and DRbTCPSocket, but not for
DRbObject! (in fact if the Client just got disconnected, alive? will still
return true)
Does somebody already met this? (And does somebody knows what DRb is?^^
Please have a look it's pretty cool, but the documentation could even be
better...)
Benoit
Hi,
I found a feature that seem to be missing to me in DRb.
I'm just creating a chat with a client and a server, using only DRb to
interact between them.
My problem is I didn't found a nice way to verify if a client is alive.
I would like to be able to update my clients' list, but I need to know if
they are alive.
Currently, I'm getting around with catching the Exception DRb:RbConnError,
but that looks really ugly:
@clients.each { |c|
begin
c.respond_to?some_method_defined_in_client) #Trying to use any method
of c will raise the exception (except if not defined)
rescue DRb:RbConnError
@clients.delete(c)
end
}
Using Exceptions would be meaningful when I try to send(it would raise the
exception if I call #send), but then I would have to manage Exceptions
everywhere.
The method alive? is defined for the DRbServer and DRbTCPSocket, but not for
DRbObject! (in fact if the Client just got disconnected, alive? will still
return true)
Does somebody already met this? (And does somebody knows what DRb is?^^
Please have a look it's pretty cool, but the documentation could even be
better...)
Benoit