标签:
#Server
from SocketServer import ThreadingMixln
from SimpleXMLRPCServer import SimpleXMLRPCServer
class ThreadXMLRPCServer(ThreadingMixln, SimpleXMLRPCServer):
pass
def register_fun():
pass
server = ThreadXMLRPCServer((‘‘, 8899), allow_none = True)
server.register(register_fun)
print ‘Listening on 8899 ...‘
server.serve_forever()
#Client
from xmlrpclib import ServerProxy
print ‘Connect to server ...‘
proxy = ServerProxy(‘http://localhost:8899‘)
proxy.register_fun()
标签:
原文地址:http://my.oschina.net/colben/blog/501921