    def handle(self, adapter, events):
        '''
        @brief: 处理epoll事件
        @param adapter: 事件对应的adapter
        @type adapter: AdapterProxy
        @param events: epoll事件
        @param events: int
        @return: None
        @rtype: None
        '''
        tarsLogger.debug('FDReactor:handle events : %d', events)
        assert(adapter)

        try:
            if events == 0:
                return

            if events & (select.EPOLLERR | select.EPOLLHUP):
                tarsLogger.debug('FDReactor::handle EPOLLERR or EPOLLHUP: %s',
                                 adapter.trans().getEndPointInfo())
                adapter.trans().close()
                return

            if adapter.shouldCloseTrans():
                tarsLogger.debug('FDReactor::handle should close trans: %s',
                                 adapter.trans().getEndPointInfo())
                adapter.setCloseTrans(False)
                adapter.trans().close()
                return

            if adapter.trans().isConnecting():
                if not adapter.finishConnect():
                    return

            if events & select.EPOLLIN:
                self.handleInput(adapter)

            if events & select.EPOLLOUT:
                self.handleOutput(adapter)

        except Exception as msg:
            tarsLogger.error('FDReactor handle exception: %s', msg)
@brief: 处理epoll事件
@param adapter: 事件对应的adapter
@type adapter: AdapterProxy
@param events: epoll事件
@param events: int
@return: None
@rtype: None
biliup/Danmaku/tars/__trans.py