MqttCommunicationException after client connect
See original GitHub issueHello,
I am using this library and have tried both v2.4 (nuget and master branch). On my laptop, it works when its connected to WiFi (internet) and ethernet cable (IP camera).
When I test it without WiFi and only IP camera connected via ethernet, MQTT client connects and disconnects immediately with following exception:
2017-11-06 16:54:46.2571 | DEBUG | ### CONNECTED TO SERVER ###
2017-11-06 16:54:46.2571 | DEBUG | ### DISCONNECTED FROM SERVER ###
2017-11-06 16:54:46.3551 | ERROR | mqttClient.Connected
EXCEPTION: MQTTnet.Core.Exceptions.MqttCommunicationException: The client is not connected.
at MQTTnet.Core.Client.MqttClient.ThrowIfNotConnected()
at MQTTnet.Core.Client.MqttClient.<SubscribeAsync>d__22.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at UVSS_App.FormUVSS.<<-ctor>b__31_0>d.MoveNext() in D:\Projects
The system where the app is going to be deployed only have ethernet connection without internet. Same issue, connection is established but disconnected immediately.
I have enabled anonymous login on mosquitto service running on same laptop (localhost), but it still does the same thing. I am not binding mqtt server to any IP, it works only on my laptop with I have both WiFi and ethernet cable connected.
What could be the reason for such behavior? any pointers?
Issue Analytics
- State:
- Created 6 years ago
- Comments:5

Top Related StackOverflow Question
This issue is fixed in the preview version 2.5.2-rc1 (available as nuget). Please let me know if the issue is now fixed.
Using the latest version from nuget, and issue seems to be fixed 😃