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
Exception raised when two MQTT client subscribes whith the same ClientID #44
Comments
What should the broker do instead thou? Drop connection? Refuse connection to the current one? |
Hi, |
that does make sense |
Actually official spesification says that:
http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718032 Answer from stack-exchange: https://iot.stackexchange.com/questions/504/what-will-be-the-result-of-the-following-connection-scenario-in-an-mqtt-network |
As Vladimir says and as is common behaviour among brokers, the broker should allow the connection of the new client and disconnect the existing one, since they're considered the same client that tries to reconnect and the previous connection is "stale". so the question actually is: what does the broker currently do and how do you get into a situation where there are more than one clients with the same ID connected? |
I found an Exception raised when two MQTT client subscribes whith the same ClientID.
The exception is raised in MqttPublisherManager.cs in method PublishThread() in the following line
var query = from p in this.retainedMessages where (new Regex(subscription.Topic)).IsMatch(p.Key)
// check for topics based also on wildcard with regex
select p.Value;
Exception is raised because
subscription.Topic
is null.Each ClientID must be unique, but if it happens, this issue appears.
Regards
The text was updated successfully, but these errors were encountered: