def run_recieve(room_id): """Run the program of recieving danmakus. :param room_id: the id of live room. """ danmaku_queue = DanmakuQueue(room_id) try: with generate_socket(room_id) as sock: produce_danmaku.switch(sock, danmaku_queue, True) except RuntimeError and KeyboardInterrupt: pass
def run_recieve(room_id): """Run the program of recieving danmakus. :param room_id: the id of live room. """ danmaku_queue = DanmakuQueue(room_id) try: with generate_socket(room_id) as sock: produce_danmaku.switch(sock, danmaku_queue, True) except RuntimeError: pass
def run_recieve(room_id): """Run the program of recieving danmakus. :param room_id: the id of live room. """ danmaku_queue = DanmakuQueue(room_id) print "请求服务器连接" while True: with generate_socket(room_id) as sock: try: produce_danmaku.switch(sock, danmaku_queue, True) except RuntimeError and KeyboardInterrupt: continue