Closed LADSoft closed 4 years ago
This is a known issue. It is hard to fix (as you can see in the stackoverflow post). Please try the upcoming 3.0.9-rc2. We made some changes in order to catch those exceptions.
@LADSoft Would you consider this as fixed now?
will check it out tomorrow.
it seems to work ok.
we have a bug in our app where we aren't passing messages through to a broken and back properly, so we time out. We are the client, using MqttNet. On a timeout we attempt to close the client (via _client.DisconnectAsync()) and then we dispose it. Some time later the app crashes with an exception on a worker thread, related to the fact that when MqttNet closes a socket it might get an 'object disposed' exception from system worker threads related to when the socket was previously open. Here is what stack overflow says about having to explicitly deal with this issue:
https://stackoverflow.com/questions/37135733/after-disposing-async-socket-net-callbacks-still-get-called