Git Product home page Git Product logo

Comments (7)

fpagliughi avatar fpagliughi commented on August 18, 2024

That seems reasonable one way or the other - make the options classes overridable or finish the full coverage of the C struct with getters/setters.

I was planning on adding full coverage of the underlying C struct for the 1.0 release of the library within the next few weeks, although I have yet to look at the automatic-reconnect capability of the C library and the implications it might have,

But I hadn't thought of making the options classes overridable. Other than making the data members protected, I suppose the classes would need virtual destructors.

Just out of curiosity, what are you trying to accomplish by overriding the connect_options class?

from paho.mqtt.cpp.

okvorb avatar okvorb commented on August 18, 2024

I just want to enable ssl options and automatic reconnect feature. That is why I need to get access to the underlying C struct. Actually I have just made opts_ member protected and created derived class and that's it! Everything works fine. There is no need to have virtual destructor for connect_options class because it is a super simple wrapper for C struct and it is reasonable to leave it so. The only thing I am missing now is offline buffering options (MQTTAsync_createOptions). Are you planning to implement it for the 1.0 release? Consider to replace MQTTAsync_create calls with MQTTAsync_createWithOptions analog that accepts additional argument of MQTTAsync_createOptions type. I can create a pull request. Does it make sense? I am looking forward to the 1.0 release. It's the only really nice c++ mqtt client that I know for now.

from paho.mqtt.cpp.

fpagliughi avatar fpagliughi commented on August 18, 2024

The SSL options are already available. Have you been working with the latest 'develop' branch?

And, yes. The idea for the C++ v1.0 release is to have full coverage of all the features of the upcoming Paho C v1.2 library, which will be released at the same time.

from paho.mqtt.cpp.

okvorb avatar okvorb commented on August 18, 2024

I have been working with master branch but will have a look at the develop branch. Thanks.

from paho.mqtt.cpp.

fpagliughi avatar fpagliughi commented on August 18, 2024

OK. Sorry to flip-flop!
The latest (fairly stable) code was just pushed to 'master'. This builds against the released Paho C, v1.1.

The 'develop' branch will be changing rapidly over the next few weeks as we push to the C++ v1.0 release. This will build against the upcoming Paho C v1.2 (the current 'develop' branch of the C library).

So use the develop branch with caution.

from paho.mqtt.cpp.

fpagliughi avatar fpagliughi commented on August 18, 2024

I think I'm closing in on all of your requirements. Have a look at the latest code in the develop branch. The createWithOptions is covered with some new client constructors, and the connect_options covers the latest version of the underlying C connect structure. I'm sure I've missed something, but will give it a review or two before the release. But if you spot something, let me know.

from paho.mqtt.cpp.

okvorb avatar okvorb commented on August 18, 2024

It looks like everything is covered for now. Thanks.

from paho.mqtt.cpp.

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.