    def checkActive(self, forceConnect=False):
        '''
        @brief: 检测连接是否失效
        @param forceConnect: 是否强制发起连接，为true时不对状态进行判断就发起连接
        @type forceConnect: bool
        @return: 连接是否有效
        @rtype: bool
        '''
        tarsLogger.debug('AdapterProxy:checkActive')
        # self.__lock.acquire()
        lock = LockGuard(self.__lock)
        tarsLogger.info('checkActive, %s, forceConnect: %s',
                        self.__trans.getEndPointInfo(), forceConnect)

        if not self.__trans.isConnecting() and not self.__trans.hasConnected():
            self.doReconnect()

        # self.__lock.release()
        return self.__trans.isConnecting() or self.__trans.hasConnected()
@brief: 检测连接是否失效
@param forceConnect: 是否强制发起连接，为true时不对状态进行判断就发起连接
@type forceConnect: bool
@return: 连接是否有效
@rtype: bool
biliup/Danmaku/tars/__adapterproxy.py