from SimpleXMLRPCServer import SimpleXMLRPCServer, SimpleXMLRPCRequestHandlerfrom SocketServer import ForkingMixInclass Math: def pow(self, x, y): return pow(x, y) def hex(self, x): return "%x" % x def sortlist(self, l): l = list(l) l.sort() return lclass ForkingServer(ForkingMixIn, SimpleXMLRPCServer): passserveraddr = ('', 8765)srvr = ForkingServer(serveraddr, SimpleXMLRPCRequestHandler)srvr.register_instance(Math())srvr.register_introspection_functions()srvr.register_function(int)srvr.register_function(list.sort) # Won't work!srvr.serve_forever()
Name (required)
email (will not be published) (required)
Website