Code Monkey home page Code Monkey logo

Comments (4)

ioolkos avatar ioolkos commented on June 6, 2024

@mths1 We would want it to disconnect in both cases but mosquitto is a re-connecting client.

Can you add the debug option (-d) to mosquitto_sub` to see the different behaviour?


👉 Thank you for supporting VerneMQ: https://github.com/sponsors/vernemq
👉 Using the binary VerneMQ packages commercially (.deb/.rpm/Docker) requires a paid subscription.

from vernemq.

mths1 avatar mths1 commented on June 6, 2024

On one hand, it seems I am really observing some implementation detail of mosquitto sub, on the other hand VerneMQ closes the session differently with (-c and without):

vmq-admin session disconnect client-id=test1

mosquitto_sub -t test -d -i test1 -V 5
Client test1 sending CONNECT
Client test1 received CONNACK (0)
Client test1 sending SUBSCRIBE (Mid: 1, Topic: test, QoS: 0, Options: 0x00)
Client test1 received SUBACK
Subscribed (mid: 1): 0
Received DISCONNECT (152)

vmq-admin session disconnect client-id=test1 -c

mosquitto_sub -t test -d -i test1 -V 5
Client test1 sending CONNECT
Client test1 received CONNACK (0)
Client test1 sending SUBSCRIBE (Mid: 1, Topic: test, QoS: 0, Options: 0x00)
Client test1 received SUBACK
Subscribed (mid: 1): 0
Client test1 sending CONNECT
Client test1 received CONNACK (0)
Client test1 sending SUBSCRIBE (Mid: 2, Topic: test, QoS: 0, Options: 0x00)
Client test1 received SUBACK
Subscribed (mid: 2): 0

MQTTv3 always reconnects

Client test1 sending CONNECT
Client test1 received CONNACK (0)
Client test1 sending SUBSCRIBE (Mid: 1, Topic: test, QoS: 0, Options: 0x00)
Client test1 received SUBACK
Subscribed (mid: 1): 0
Client test1 sending CONNECT
Client test1 received CONNACK (0)
Client test1 sending SUBSCRIBE (Mid: 2, Topic: test, QoS: 0, Options: 0x00)
Client test1 received SUBACK
Subscribed (mid: 2): 0

from vernemq.

ioolkos avatar ioolkos commented on June 6, 2024

Thanks, so it's about whether the DISCONNECT is received or not.
We can check if it's the network or the implementation.

Can you add something like the following options to vernemq.conf: (the point is to set the linger option to something other than 0):

tcp_listen_options = [{nodelay, true}, {linger, {true, 6}}, {send_timeout, 30000}, {send_timeout_close, true}]

👉 Thank you for supporting VerneMQ: https://github.com/sponsors/vernemq.
👉 Using the binary VerneMQ packages commercially (.deb/.rpm/Docker) requires a paid subscription.

from vernemq.

mths1 avatar mths1 commented on June 6, 2024

I close this, as it is an implementation detail of mosquitto. The tcl_listen_options did not change the behaviour.

from vernemq.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.