473,385 Members | 1,320 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Failure to connect in SimpleXMLRPCServer/xmlrpclib

iu2

Hi all,

I've copied the example of RPC usage from the Python's doc.
When the client and server were on the same PC ("localhost") (I use
Windows)
it worked ok. But putting the server on a different PC raised the
error:

gaierror: (11001, 'getaddrinfo failed')
The error was raised upion accessing some function of the server,
i.e.,
print s.add_nums(1, 2, 3) # server registered function

PCs in our organization are accessed by "\\<name>" so I used

s = xmlrpclib.Server(r'http://\\pc_name:8000')
I got the same error when I put some non-existing name.
Trying to remove the double-backslash from the PC's name raised the
error:
error: (10061, 'Connection refused')

I'll appreciate your help on this.

Thanks
iu2

Oct 22 '07 #1
5 3905
iu2 wrote:
>
Hi all,

I've copied the example of RPC usage from the Python's doc.
When the client and server were on the same PC ("localhost") (I use
Windows)
it worked ok. But putting the server on a different PC raised the
error:

gaierror: (11001, 'getaddrinfo failed')
The error was raised upion accessing some function of the server,
i.e.,
print s.add_nums(1, 2, 3) # server registered function

PCs in our organization are accessed by "\\<name>" so I used

s = xmlrpclib.Server(r'http://\\pc_name:8000')
I got the same error when I put some non-existing name.
Trying to remove the double-backslash from the PC's name raised the
error:
error: (10061, 'Connection refused')

I'll appreciate your help on this.
Maybe using the IP-address helps?

Diez
Oct 22 '07 #2
iu2
On Oct 22, 10:21 am, "Diez B. Roggisch" <de...@nospam.web.dewrote:
iu2 wrote:
Hi all,
I've copied the example of RPC usage from the Python's doc.
When the client and server were on the same PC ("localhost") (I use
Windows)
it worked ok. But putting the server on a different PC raised the
error:
gaierror: (11001, 'getaddrinfo failed')
The error was raised upion accessing some function of the server,
i.e.,
print s.add_nums(1, 2, 3) # server registered function
PCs in our organization are accessed by "\\<name>" so I used
s = xmlrpclib.Server(r'http://\\pc_name:8000')
I got the same error when I put some non-existing name.
Trying to remove the double-backslash from the PC's name raised the
error:
error: (10061, 'Connection refused')
I'll appreciate your help on this.

Maybe using the IP-address helps?

Diez- Hide quoted text -

- Show quoted text -
No, that doesn't help either.
May be I don't use it right.
I tried "http://1.2.3.4:8000"
and
r"http://\\1.2.3.4:8000"

with no success.

Oct 22 '07 #3
>Maybe using the IP-address helps?
>>
Diez- Hide quoted text -

- Show quoted text -

No, that doesn't help either.
May be I don't use it right.
I tried "http://1.2.3.4:8000"
and
r"http://\\1.2.3.4:8000"

with no success.
The former should work. The latter is Windows-name-style and has nothing to
do here.

I'm not a windows-user, but there should be ways to determine which program
listens to which port on a machine.

And a common problem is that servers listen on 127.0.0.1 instead of the
ethernet interface.

Try putting the server's IP as argument to the listening XMLRPC-server, and
check with the windows-netstat-equivalent if it works out.

Diez
Oct 22 '07 #4
iu2 wrote:
Hi all,

I've copied the example of RPC usage from the Python's doc.
When the client and server were on the same PC ("localhost") (I use
Windows)
it worked ok. But putting the server on a different PC raised the
error:

gaierror: (11001, 'getaddrinfo failed')
The error was raised upion accessing some function of the server,
i.e.,
print s.add_nums(1, 2, 3) # server registered function

PCs in our organization are accessed by "\\<name>" so I used

s = xmlrpclib.Server(r'http://\\pc_name:8000')
I got the same error when I put some non-existing name.
Trying to remove the double-backslash from the PC's name raised the
error:
error: (10061, 'Connection refused')

I'll appreciate your help on this.

Thanks
iu2

Don't use the \\. That's a windows networking convention, and it does
not apply if you are using http. Your error messages tell you this.
The first one (r'http://\\pc_name:8000') could not resolve the address.
The second one reached the server just fine, but the server rejected the
client's request. So now the issue is why is the request being
rejected? Did you check your firewall to see if it is blocking access
to port 8000 on the ethernet adapter?

Cheers,
Cliff
Oct 22 '07 #5
iu2
On Oct 22, 12:47 pm, "J. Cliff Dyer" <j...@sdf.lonestar.orgwrote:
iu2 wrote:
Hi all,
I've copied the example of RPC usage from the Python's doc.
When the client and server were on the same PC ("localhost") (I use
Windows)
it worked ok. But putting the server on a different PC raised the
error:
gaierror: (11001, 'getaddrinfo failed')
The error was raised upion accessing some function of the server,
i.e.,
print s.add_nums(1, 2, 3) # server registered function
PCs in our organization are accessed by "\\<name>" so I used
s = xmlrpclib.Server(r'http://\\pc_name:8000')
I got the same error when I put some non-existing name.
Trying to remove the double-backslash from the PC's name raised the
error:
error: (10061, 'Connection refused')
I'll appreciate your help on this.
Thanks
iu2

Don't use the \\. That's a windows networking convention, and it does
not apply if you are using http. Your error messages tell you this.
The first one (r'http://\\pc_name:8000') could not resolve the address.
The second one reached the server just fine, but the server rejected the
client's request. So now the issue is why is the request being
rejected? Did you check your firewall to see if it is blocking access
to port 8000 on the ethernet adapter?

Cheers,
Cliff- Hide quoted text -

- Show quoted text -
Cliff and Diez, thanks. That helped. The server indeed was listening
on 127.0.0.1. I changed the hostname from "localhost" to
socket.gethostname() and it worked!

Oct 22 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Larry | last post by:
I've had a production system running for a long time that uses xmlrpclib with timeoutsocket, and with my recent upgrade to 2.3 it's no longer able to use xmlrpclib with the xmlrpc servers I...
0
by: danu kusmana | last post by:
Hi Im trying to figure out why the same server script I use is running slower in Windows than in Linux. ServerTest.py: #! /usr/bin/env python import SocketServer
2
by: Skip Montanaro | last post by:
I decided to use SimpleXMLRPCServer for an xml-rpc server. As I understand it, if I register an instance like so: myserver.register_instance(MyStuff()) then it will call...
3
by: Daniel Crespo | last post by:
Hello, Does anyone know which methods do I have to override for allowing Nones to be accepted and sended from SimpleXMLRPCServer to the client? Thanks Daniel
2
by: Laszlo Nagy | last post by:
Hello, I ran in the same problem again. Many others have the same problem. Just Google for this: "SimpleXMLRPCServer allow_none site:python.org". Looks like the 'allow_none' patch was commited...
0
by: Rudy Schockaert | last post by:
After some Googling I found a post of someone who wanted to do exactly as what I want to do now. There is however a problem in his code that makes the service fails after the first connection. I...
3
by: Achim Domma | last post by:
Hi, is SimpleXMLRPCServer multithreaded or how does it handle multiple clients? I want to implement a simple server which will be queried by multiple processes for work to be done. The server...
3
by: Sean DiZazzo | last post by:
Why is the following not working? Is there any way to get keyword arguments working with exposed XMLRPC functions? ~~~~~~~~~~~~~~~~ server.py import SocketServer from SimpleXMLRPCServer import...
0
by: Russell Warren | last post by:
I'm running python 2.5.1 and it seems that SimpleXmlRpcServer is not setup to support the base datetime module in the same way xmlrpclib has been with "use_datetime". I see that someone (Virgil...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.