MQTT：pcb has been used up because too many ack packets were lost
I am developing MQTT related project and encountered problems in the
situation when I continuously unpluged the Ethernet and made client keep
failing to receive the expected ack packets.
According to the protocol, the related tcp pcb will wait in the stack for
the ack packets before it can be freed. To solve this problem, I called
*tcp_pcb_purge()* in *lwip_netconn_do_close_internal()* to release the tcp
pcb. and set *tpcb->snd_queuelen* to 0. The problem seems to be solved.
I would like to ask is there anyone met similar issues and is there any
better solution to solve this issue?
How do you think about this fix?