【问题贴】关于umqtt断开重连后只能发送消息不能接收消息

我使用umqtt需要断开重连,按照官方的实例写的listen函数专门用来处理waitmsg,结果只要我断开重连,并且重启listen函数之后waitmsg就会收不到消息

    def run(self):
        if self.get_connect_state() == 0:
            print("Mqtt connect server")
            self.connect()
        if self.thread_id == None:
            print("Mqtt listen run")
            self.listen()
    def stop(self):
        if self.thread_id != None:
            print("stop listen")
            _thread.stop_thread(self.thread_id)
            self.thread_id = None
        if self.get_connect_state() == 1:
            try:
                print("mqtt close connect")
                self.connect_state = 0
                self.cli.close()
                return True
            except Exception as e:
                print("disconnect failed:", e)
                return False
    def listen_thread_worker(self):#这是waitmsg线程,线程栈按照文档建议给的16*1024
        while True:
            try:
                if (self.connect_state != 0):
                    self.cli.wait_msg()
                else:
                    utime.sleep_ms(10)
                    continue
            except Exception as e:
                self.put_error(error.ListenError())
                if(self.connect_state != 0):
                    self.cli.close()
                self.connect()
    def recv(self):
        return self.queue.get()

这是我的代码,望大佬指教

芯片型号EC600U

我刚刚测试发现如果直接结束waitmsg的线程就会出现上述问题,但是如果我先关闭连接此时会触发waitmsg报错再结束线程那么下次启动mqtt与waitmsg线程时就可以收到消息,推测是waitmsg占用了某个资源,而结束线程不会释放这个资源,只有等它报错才会释放资源,希望官方能作出回答