Python 的 多线程xmlrpcserver

服务端:

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_function(register_fun)

print 'Listening on 8899 ...'

server.serve_forever()


客户端:

from xmlrpclib import ServerProxy

print 'Connect to server ...'

proxy = ServerProxy('http://localhost:8899')

proxy.register_fun()


你可能感兴趣的:(Python 的 多线程xmlrpcserver)