从 Mac 连接到 Python XML RPC
我用 python 编写了一个 XML RPC 服务器,并用 python 为其编写了一个简单的测试客户端。服务器在 Linux 机器上运行。我通过在同一台 Linux 机器上运行 python 客户端来测试它,它可以工作。
然后我尝试在 Mac 上运行 python 客户端,出现以下错误:
socket.error: (61, 'Connection Refused')
我可以从 Mac ping 和 ssh 到 Linux 机器。所以我不认为这是配置或防火墙错误。
有谁知道可能出了什么问题吗?
客户端的代码如下:
import xmlrpclib
s = xmlrpclib.ServerProxy('http://143.252.249.141:8000')
print s.GetUsers()
print s.system.listMethods()
I wrote an XML RPC server in python and a simple Test Client for it in python. The Server runs on a linux box. I tested it by running the python client on the same linux machine and it works.
I then tried to run the python client on a Mac and i get the following error
socket.error: (61, 'Connection Refused')
I can ping and ssh into the linux machine from the Mac. So i dont think its a configuration or firewall error.
Does anyone have any idea what could be going wrong?
The code for the client is as below:
import xmlrpclib
s = xmlrpclib.ServerProxy('http://143.252.249.141:8000')
print s.GetUsers()
print s.system.listMethods()
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
“连接被拒绝”表示连接被拒绝 - 计算机
143.252.249.141
已启动,并且在网络中,但不接受端口8000
上的连接code> - 它正在积极拒绝它们。那么服务器软件可能没有在服务器上运行吗?或者正在另一个端口运行?或者绑定到不同的IP地址?
"Connection Refused" means the connection was REFUSED - the machine
143.252.249.141
is up, and in the network, but is not accepting connections on port8000
- it is actively refusing them.So maybe the server software isn't running on the server? Or is running in another port? Or is bound to a different IP address?