471,349 Members | 1,176 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,349 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 3787
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by danu kusmana | last post: by
2 posts views Thread by Skip Montanaro | last post: by
3 posts views Thread by Daniel Crespo | last post: by
2 posts views Thread by Laszlo Nagy | last post: by
reply views Thread by Rudy Schockaert | last post: by
3 posts views Thread by Achim Domma | last post: by
3 posts views Thread by Sean DiZazzo | last post: by

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.