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

incorrect in-order expectations with non clean session #4

Closed
aep opened this issue Mar 12, 2015 · 2 comments
Closed

incorrect in-order expectations with non clean session #4

aep opened this issue Mar 12, 2015 · 2 comments

Comments

@aep
Copy link

aep commented Mar 12, 2015

when not setting clean-session, the broker may answer a CONNECT with the previous subscriptions as REGISTER message, as specified in MQTT-SN_spec_v1.2.pdf paragraph 6.10.

however, mqtt-sn-sub espects SUBSCRIBE to be immediately followed by SUBACK and dies on any message left in the brokers queue. This will probably happen with a leftover PUBLISH as well.

./mqtt-sn-sub -d -t foo -1  -i blabla -c
Sending CONNECT packet...
waiting for packet...
Received 3 bytes. Type=CONNACK.
CONNACK return code: 0x00
Sending SUBSCRIBE packet...
waiting for packet...
Received 13 bytes. Type=REGISTER.
Was expecting SUBACK packet but received: 0x0a

a

@aep aep changed the title incorrect expectations with non clean session incorrect in-order expectations with non clean session Mar 12, 2015
@njh
Copy link
Owner

njh commented Mar 22, 2015

Thanks for reporting... not quite sure how I'm going to fix this yet!

Think it may require having a packet buffer, so that they can be processed out of order.

@njh njh closed this as completed in 3ccd9c8 Jul 31, 2015
@njh
Copy link
Owner

njh commented Jul 31, 2015

This should be fixed now - mqtt-sn-sub should cope with the server sending both Register and Publish packets straight after the Connack.

Do you mind double checking?

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

No branches or pull requests

2 participants