By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,222 Members | 2,354 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,222 IT Pros & Developers. It's quick & easy.

Python XML-RPC localhost problem

100+
P: 152
Hello,

i have a simple xml rpc server running on a host (e.g. 1.2.3.4)... the server has the following address:
servAddr = ("localhost", 8080)..

when i run the client on a different machine (e.g. 5.6.7.8) i get a connection refused error...

however, when i change the line
servAddr = ("localhost", 8080)
to
servAddr = ("1.2.3.4", 8080)

everything works fine...

what's wrong?

(note: both machines run linux in case this is a network related problem and not a python related one)

thanks for your time...
Feb 23 '11 #1
Share this Question
Share on Google+
1 Reply


Andr3w
P: 42
Hey mate,

I am 99 % sure that's not a python related issue...most likely the server goes and binds in 127.0.0.1...which on most (if not all) systems is defined as a local only and loop-back interface so you can't access it outside the machine you are running the server, so the connection refused error is quite normal. There is of course a chance that you have a multi-homed host with bridged interfaces, so even if you bind using 'local-host' as an address you will be bound in the 'primary' external interface (in most cases eth0)

If you alter your network configuration it will be fine, I think... or you'll just have to type the address yourself!

Hope this helped,

Cheers!
Apr 6 '11 #2

Post your reply

Sign in to post your reply or Sign up for a free account.