Skip to content
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

connecting at the same time with mqtt3 and mqtt5 to the same broker does not work #587

Open
justme-1968 opened this issue Apr 25, 2024 · 4 comments
Labels

Comments

@justme-1968
Copy link

this is probably not relevant 'in the real world' but during some testing of my client i noticed that connecting from the client at the same time with mqtt3 and mqtt5 to the same broker does not work.

only the last connection will receive messages as expected. the other one will result in an empty topic with the expected payload.

@JaylinYu
Copy link
Member

remember, mqtt is a stateful protocol.

@justme-1968
Copy link
Author

what has statefulness todo with that?

state is nothing that should apply between different connections.

one client opening separate connections to two different brokers works as expected. one client opening two mqtt5 connections to the same broker works as expected.

one client opening. mqtt5 and a mqtt3 connection to the same broker results in problems that look like the library is sharing something between the separate connections.

@JaylinYu
Copy link
Member

only one MQTT session is allowed in one TCP connection.

@justme-1968
Copy link
Author

why do you think it is the same tcp connection?

the problem is visible with two separate connections that happen to go the the same broker and use different matt versions. connecting to different brokers works fine as does using the same matt version to the same broker.

this looks like some internal state is shared by accident.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants