2024-06-26 15:02:46 发布
网友
我尝试使用xmlrpc和python3实现远程对象实现。 我已经在http://docs.python.org/3.1/library/xmlrpc.server.html?highlight=xmlrpc#simplexmlrpcserver-example上尝试过这个例子,但是它只在本地主机和本地主机之间工作,如何才能使它在内部IP之间工作?在
也许我误解了你的问题,但是。。。您是否尝试过在另一台计算机上运行服务器代码和客户机代码(将客户机代码s = xmlrpc.client.ServerProxy('http://localhost:8000')第一行中的“localhost”值更改为远程服务器的IP地址?在
s = xmlrpc.client.ServerProxy('http://localhost:8000')
将localhost值更新为以下值:
对于服务器:s = SimpleXMLRPCServer(("ServerIp", 8000))
s = SimpleXMLRPCServer(("ServerIp", 8000))
对于客户端:s = xmlrpc.client.ServerProxy("http://ServerIp:8000/")
s = xmlrpc.client.ServerProxy("http://ServerIp:8000/")
也许我误解了你的问题,但是。。。您是否尝试过在另一台计算机上运行服务器代码和客户机代码(将客户机代码
s = xmlrpc.client.ServerProxy('http://localhost:8000')
第一行中的“localhost”值更改为远程服务器的IP地址?在将localhost值更新为以下值:
对于服务器:
s = SimpleXMLRPCServer(("ServerIp", 8000))
对于客户端:
s = xmlrpc.client.ServerProxy("http://ServerIp:8000/")
相关问题 更多 >
编程相关推荐