Пример #1
0
        def create_server():
            def retObj():
                return A(10)

            server = TcpRpcServer('127.0.0.1', 10004)
            server.regist(retObj)
            server.serve()
Пример #2
0
 def create_server():
     from agileutil.rpc.server import TcpRpcServer
     from agileutil.rpc.compress import RpcCompress
     RpcCompress.DEBUG = True
     RpcCompress.enableCompressLen = 200
     server = TcpRpcServer('127.0.0.1', 10019)
     server.regist(sayHello)
     server.serve()
Пример #3
0
        def create_server():
            from agileutil.rpc.server import TcpRpcServer

            def retObj():
                return A(10)

            server = TcpRpcServer('127.0.0.1', 10004)
            server.regist(retObj)
            server.serve()
Пример #4
0
 def create_server():
     disconf = DiscoveryConfig(consulHost=CONSUL_HOST,
                               consulPort=CONSUL_PORT,
                               serviceName='test-rpc-server',
                               serviceHost=local_ip(),
                               servicePort=10001)
     server = TcpRpcServer('0.0.0.0', 10001)
     server.setDiscoverConfig(disconf)
     server.regist(sayHello)
     server.serve()
Пример #5
0
#coding=utf-8

from agileutil.rpc.server import TcpRpcServer
from agileutil.db4 import PoolDB

db = PoolDB('127.0.0.1', 3306, 'root', '', 'test2')
db.connect()


def sayHello(name):
    sql = 'select * from nation limit 100000'
    rows = db.query(sql)
    return 'hello ' + name


nationServer = TcpRpcServer('0.0.0.0', 9988)
nationServer.regist(sayHello)
nationServer.serve()
Пример #6
0
 def create_server():
     server = TcpRpcServer('127.0.0.1', 9988)
     server.regist(sayHello)
     server.serve()
Пример #7
0
 def create_server():
     server = TcpRpcServer('127.0.0.1', 10022)
     server.regist(TestService)
     server.serve()
Пример #8
0
 def create_server():
     RpcCompress.DEBUG = True
     RpcCompress.enableCompressLen = 200
     server = TcpRpcServer('127.0.0.1', 10019)
     server.regist(sayHello)
     server.serve()
Пример #9
0
 def create_server():
     server = TcpRpcServer('127.0.0.1', 10014)
     server.regist(testTimeout)
     server.regist(sayHello)
     server.serve()
Пример #10
0
 def create_server_10007():
     server = TcpRpcServer('127.0.0.1', 10007)
     server.regist(sayHello)
     server.serve()
Пример #11
0
 def create_server():
     from agileutil.rpc.server import TcpRpcServer
     server = TcpRpcServer('127.0.0.1', 9988)
     server.regist(sayHello)
     server.serve()
Пример #12
0
 def create_server():
     from agileutil.rpc.server import TcpRpcServer
     server = TcpRpcServer('127.0.0.1', 10014)
     server.regist(testTimeout)
     server.regist(sayHello)
     server.serve()