def startHttpServer():
import SimpleHTTPServer SimpleHTTPServer.test() def starRpcServer(): from SimpleXMLRPCServer import SimpleXMLRPCServerRPC_PORT = 80
def add(a , b):
return a+bdef sayHi():
return 'hi'#server = SimpleXMLRPCServer(("127.0.0.1", RPC_PORT))
server = SimpleXMLRPCServer(("localhost", RPC_PORT)) server = SimpleXMLRPCServer(("115.231.94.187", RPC_PORT))## reg
server.register_function(add) server.register_function(sayHi)server.serve_forever()
def starRPCServer():
from SimpleXMLRPCServer import SimpleXMLRPCServer server = SimpleXMLRPCServer(("192.168.16.24", 8000)) #server = SimpleXMLRPCServer(("localhost", 8000)) server.register_function(pow) server.register_function(lambda x,y: x+y, 'add') server.serve_forever()if __name__ == '__main__':
#startHttpServer() #starRpcServer() starRPCServer()