_broker.py 文件源码

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

项目:ave 作者: sonyxperiadev 项目源码 文件源码
def new_session(self, authkey):
        if authkey in self.sessions:
            raise Exception('INTERNAL ERROR: session already added for authkey')
        sock, port = find_free_port()
        session    = Session(
            port, authkey, self.address, sock, self.ws_cfg, self.home,
            self.config['logging']
        )
        session.start() # new process!
        self.join_later(session)
        remote     = RemoteSession((self.address[0], port), authkey)
        # connect to the new session and add the connection to event tracking
        try:
            self.add_connection(remote.connect(5), authkey)
        except Exception, e:
            print('ERROR: could not connect to new session: %s' % str(e))
            session.kill(signal.SIGKILL) # not much else to do
            return
        self.sessions[authkey] = (session, remote)

    # override callback defined by Control class
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号