Community
Participate
Working Groups
Hello I'm using this library extracted from M2Mqtt_4.0.0.0_bins and it generally works well for a lot of hours/days, but sometimes I get a queue empty exception and my application crashes.. --- Short message: Queue empty. Stack trace: at System.Collections.Queue.Dequeue() at uPLibrary.Networking.M2Mqtt.MqttClient.ProcessInflightThread() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() Internal error generated by: --- Terminating? Yes --- my code is as follows.. ------- MqttClient client = new MqttClient("185.x.y.z"); string clientId = Guid.NewGuid().ToString(); ... try { if (client != null) { client.Connect(clientId); } //Console.WriteLine("MQTT Connected."); } catch (Exception exc) { } ... try { if (client != null) { client.Publish("/pubstring", Encoding.UTF8.GetBytes(msg)); Console.WriteLine("\n" + msg + "\n"); client.Disconnect(); } -----------