New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clients do not receive disconnect signal #1411
Comments
Please test this with version 4 preview from the MyGet feed and let me know if the issue still exists? |
I use Visual Studio (nuget package), which one is it? 4.0.0.0-preview4 or 4.0.0.0-preview5 |
I have tried the latest version of nuget and it also fails (after modifying the code I had to version 4) However, with the System.Net.Mqtt package I don't get this error (it gives me another error that mqttnet doesn't have hahaha), doing the same thing with both packages. I hope you can help me. Thank you :) |
Are you using a different client ID for each client? What exactly is the exception from the other MQTT client library? |
Hello, sorry for the wait. Yes, I confirm and reconfirm that the clientIDs are different. It was the first thing I checked because it had happened to me before. No exception is thrown, I simply stop receiving data but the disconnect event does not occur when in the CMD where I run mosquitto it tells me "client disconnect xxxxxxxx timeout" In both Mqttnet and System.net.mqtt it happens. In mqttnet it fails more, however in system.net.mqtt it is more sporadic but from time to time it happens |
Describe the bug
Context:
I have a mosquitto server running in cmd on windows 10 and three mqtt clients in c# visual studio.
One of them (3) feeds the topics at 20 data per second (Qos 0 and retain). And the other two clients (1 and 2) feed on said data to make calculations and when they are finished, they publish them in different topics also at 20 data per second (Qos 0 and retain). In addition, they also publish information data only once per client execution (Qos 2 and retain).
'They have different ClientId'
Problem:
When I run one of the clients (1) and it starts to publish the calculated data + the information, nothing happens but if I run the other client (2) on the second, the first one stops publishing and receiving from the server.
I have been checking what is happening and the server says "client has exceeded timeout disconnecting" but the disconnect callback is not called and the affected client is not notified (2) but the property client.IsConnect == false.
No matter how much I do Client.StopAsync() and then Client.StartAsync(options), it won't reconnect unless I do new client = new MqttFactory().CreateManagedMqttClient()
Thanks for your time.
Which component is your bug related to?
To Reproduce
To reproduce it, create a small app that sends +30 topics information (20 data per second) with mqttnet to a mosquitto server executed from a cmd and the following .conf
Create two clients that while they feed on this data, make calculations with them (any simple calculation would do) and publish them in other topics at 20 data per second (the publication topics are unique for each client, although I think it does not affect the error ).
Start one of them and the second starts the other and you will see the error (at the same time it also fails)
Expected behavior
I expected normal operation, that they would not be disconnected because another client would also publish to the server (in different topics and running on different machines).
Also misses with just one, but rarer.
Screenshots
Additional context / logging
I think the error is in the publish.
.CONF server mosquitto
allow_anonymous false
password_file passwordfile.pwd
acl_file acl.acl
listener 1890
connection_messages true
max_inflight_messages 0
max_connections -1
max_topic_alias 100
max_queued_messages 10000
max_queued_bytes 0
queue_qos0_messages false
set_tcp_nodelay true
The text was updated successfully, but these errors were encountered: