* Chad Fowler <chadfowler@gmail.com> [2005-05-16 01:51:49 +0900]:
$ time ruby simple-client.rb
Connecting to druby://chad-fowlers-computer.local:51624
#<DRb::DRbObject:0x25639c
@uri="druby://chad-fowlers-computer.local:51624", @ref=nil>
1225166
["test1", "test2"]
real 0m0.215s
user 0m0.030s
sys 0m0.017s
Hmm, interesting. That used to work for me. It is probably DNS
related like Dick Davies mentioned, but I don't know how
to debug it yet. When I use a fixed address and port (e.g
localhost:2000), it works as yours.
···
--
Jim Freeze
Ruby: I can explain it to ya but I can't understand it fer ya.
* Dick Davies <rasputnik@hellooperator.net> [2005-05-16 02:45:29 +0900]:
I'd guess DNS. check your forward and reverse for both the client
and the server.
That is what I was thinking too, but then I ran it on a different
machine, and I get a no response error instead of a delayed result.
In the two cases below I use
DRb.start_service nil, obj
and
DRb.start_service dri, obj
where dri is the value originally picked by DRb itself:
"druby://rabbit:50827"
# start the server - let drb decide
% ruby drb.server
URI: 'druby://rabbit:50827'
I am server
# run the client
% ruby drb.client
#<DRb::DRbObject:0x821d804 @uri="druby://rabbit:50827", @ref=nil>
68217858
No response from server
druby://rabbit:50827 - #<Errno::ECONNREFUSED: Connection refused -
connect(2)>
# kill the old server, and manually do start_service at the previous dri:
% ruby drb.server
URI: 'druby://rabbit:50827'
I am server
% ruby drb.client
#<DRb::DRbObject:0x821d804 @uri="druby://rabbit:50827", @ref=nil>
68217858
["test1", "test2"]
# it works
So, why does the client fail if the server is running at the same
address. The only difference is that I set the address explicitly
or I let DRb choose the address.
···
--
Jim Freeze
Ruby: I can explain it to ya but I can't understand it fer ya.