Mqtt - ObjectDisposedException

Hello again friends. I am continuing my water system project, I have two working programs now, one running on a feather which records water flows (Hall Effect Sensor), and posts the data every minute or so to adafruit mqtt, and the other board (Portal) pulls that data and combines it with other data and displays and records the data to disk.

I am running both boards in test mode and posting and processing dummy data (and monitoring with a web page pointing to the feeds). I am finding that the programs run fine for a while, but then I get a ObjectDisposed Exception when one of the “PublishedReceived” events are triggered, it looks like the GC has run and decided to kill mqtt. Any ideas how I stop the GC from doing this, if that’s the problem? Or is this telling me that the wifi connection has failed? (Both boards are using the built in wifi). I’m using the networking code on the docs page to get the network running.

The error:

#### Exception System.ObjectDisposedException - 0x00000000 (4) ####
#### Message: 
#### System.Net.Sockets.Socket::Receive [IP: 000a] ####
#### GHIElectronics.TinyCLR.Networking.Mqtt.MqttStream::Receive [IP: 0093] ####
#### GHIElectronics.TinyCLR.Networking.Mqtt.Mqtt::ReceiveThread [IP: 0011] ####

As always, thanks in advance for the community’s help!!~ - John.

Hard to say anything without seeing your code.
Best regards
RoSchmi

Thanks Roland - I have a memory leak so will work on that first.