Dear Ruby Experts,
I’m quite new to Ruby and was glad to be able to use this fantastic
language for writing short scripts. I use ruby to provide several hosts
with a special service using XML-RPC. The connection works well as long as
client and server run on the same host. The connection fails if the
connection request comes from a distant host.
My server is set up with:
require “xmlrpc/server”
server = XMLRPC::Server.new(6670)
server.add_handler(“xaiServer”, RPCHandler.new)
server.serve
as it was written in the XML-RPC example. The client connect with
require “xmlrpc/client”
xaiServer = XMLRPC::Client.new(“localhost”, “/RPC2”, 6670,
nil, nil, nil, nil, false, 10)
If I change “localhost” to my IP address or full qualified host name, the
client terminates with this messages:
/usr/lib/ruby/1.6/net/protocol.rb:343:in new': Connection refused - "connect(2)" (Errno::ECONNREFUSED) from /usr/lib/ruby/1.6/net/protocol.rb:343:in
connect’
from /usr/lib/ruby/1.6/net/protocol.rb:342:in timeout' from /usr/lib/ruby/1.6/net/protocol.rb:342:in
connect’
from /usr/lib/ruby/1.6/net/protocol.rb:329:in initialize' from /usr/lib/ruby/1.6/net/protocol.rb:107:in
new’
from /usr/lib/ruby/1.6/net/protocol.rb:107:in conn_socket' from /usr/lib/ruby/1.6/net/http.rb:360:in
do_start’
from /usr/lib/ruby/1.6/net/protocol.rb:93:in start' from /usr/lib/ruby/1.6/net/http.rb:490:in
request’
from /usr/lib/ruby/1.6/net/http.rb:473:in request_post' from /usr/lib/ruby/1.6/xmlrpc/client.rb:488:in
do_rpc’
from /usr/lib/ruby/1.6/xmlrpc/client.rb:382:in call2' from /usr/lib/ruby/1.6/xmlrpc/client.rb:372:in
call’
from ./getPresentations:35
If I use only the hostname (my system is able to resolve its hostname), I
get a timeout error:
/usr/lib/ruby/1.6/timeout.rb:35:in `connect’: execution expired
(TimeoutError)
Any advice?
Yours,
Rene