Bug 499636 - Unmanaged exception: queue empty
Summary: Unmanaged exception: queue empty
Status: UNCONFIRMED
Alias: None
Product: Paho
Classification: IoT
Component: M2MQTT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Server 2008
: P3 blocker (vote)
Target Milestone: 1.2   Edit
Assignee: Paolo Patierno CLA
QA Contact: Ian Craggs CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-13 05:26 EDT by David Chr CLA
Modified: 2016-08-13 05:28 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Chr CLA 2016-08-13 05:26:36 EDT
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();

                                       }

-----------