Closed eladnava closed 8 years ago
I'm thinking we can have a three way case: destroySoon
, destroy
and end
. In this order.
What do you think?
@mcollina Done, however I wasn't able to run the tests completely as I don't have Redis installed.
@behard what do you think?
I think you meant @behrad =)
Oh yes :D.
So it should reduce FIN_WAIT
s :)
If destroySoon is preferable, how will that affect on the mobile/public facing client end?
@behrad When connected clients passively disconnect from the internet, they will eventually be kicked due to Mosca's keepalive timeout mechanism, which calls socket.end()
if the client hasn't sent an MQTT keep alive packet within the client-defined time limit.
In its current implementation, calling socket.end()
on those connections will have them stuck (if not indefinitely, then for a long time) in FIN_WAIT states because the TCP stack will attempt to let the client know it's closing down the connection. But since the client is no longer reachable then the server will never be able to deliver the FIN/ACK packet to the client, nor will it receive a FIN/ACK or an ACK from the client in response to the FIN/ACK.
Does that answer your question?
great explanation @eladnava 👍 I can test to see how this patch will change the real world scenario :)
@behrad excellent, please let us know if it's OK to merge :)
Ping @behrad? I'll like to merge this and release next week!
Sorry guys, so busy these days, it takes me some time to test this, I'l let you even after @mcollina releases this :)
@mcollina Has this been released yet? I'd love to use it in production. Thanks! 😄
Sorry, released now as v2.1.0.
Excellent, thank you! 👍
As per #306.