Ejemplo n.º 1
0
def reportServerStatus(clientSign , getTokenSum , failToken , statusInfo):
    try:
        transport = TSocket.TSocket(config['SERVER_IP'], config['SERVER_PORT'])
        transport = TTransport.TBufferedTransport(transport)
        protocol = TBinaryProtocol.TBinaryProtocol(transport)
        client = Motor.Client(protocol)
        transport.open()
        client.reporTokenStatus( clientSign, statusInfo, failToken, getTokenSum)
        transport.close()
    except Thrift.TException, ex:
        log.info('链接服务器失败 错误 # %s #' % ex)    
Ejemplo n.º 2
0
def getNotVaildTokenInfoBySize(size):
    tokenUpdateList = []
    try:
        log.info('正在与服务器链接---')
        transport = TSocket.TSocket(config['SERVER_IP'], config['SERVER_PORT'])
        transport = TTransport.TBufferedTransport(transport)
        protocol = TBinaryProtocol.TBinaryProtocol(transport)
        client = Motor.Client(protocol)
        transport.open()
        tokenUpdateList = client.getVaildTokenInfoBySize(config['CLIENT_SIGN'], size)
        log.info('开始访问服务器,获得失效列表-')
        transport.close()
    except Thrift.TException, ex:
        log.info('链接服务器失败 错误 # %s #' % ex)