control.py 文件源码

python
阅读 36 收藏 0 点赞 0 评论 0

项目:ave 作者: sonyxperiadev 项目源码 文件源码
def step_listener(self, connection, event, fd):
        #print('%s(%s, %s)' %
        #   (inspect.currentframe().f_code.co_name,connection,event_str(event)))

        if event & ERRMASK:
            raise Exception('INTERNAL ERROR. LISTENER NEVER DIES')

        elif event & INMASK:
            new = self.accept(connection)
            if not new:
                # happens if peer hangs up during accept or the control is
                # rejecting new connections
                return
            self.pollable(new.fileno(), new, OUTMASK)
            self.accepting.append(new)
            # ignore all events for the same file descriptor in the current step
            # of the main loop. the OS may reuse descriptors aggressively and so
            # the events list may include POLLNVAL for the same descriptor. we
            # don't need to handle such a POLLNVAL event because that connection
            # is replaced (and GCed) by the call to self.pollable() above.
            self.unpend.append(new.fileno())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号