Open pzx601917159 opened 7 years ago
Can you upload an example?
Sorry,it's just happened in my online server.Running longer, more dead connections(without any packet with tcpdump).I used the setKeepAlive option when authenticate,but it's not work(maybe not emit authenticate).
Thank you.I solved the problem today.I use my 4g phone telnet to mosca server,and close my 4g network.The problem is happend.The client will not release forever(until close the server).It's may happend in some weak network place。Is it a bug?May i pull request to mosca?Mosca allow a tcp connect without any mqtt packet. So i modify mosca/lib/client.js: 1st init keepalive in client construct: this.keepalive = 5; 2nd add setuptimer int Client.prototype._setup function start: that.setUpTimer(); I use the timer to close the illegal tcp connection(may be dead connection),and it's work.
That's a similar approach I had in aedes. However, this will likely need another timer, as that one is a keepalive one (with its own logic). Would you like to send a PR?
My pleasure.
Client connect without any packet,and the client internet is unavailable.