GithubHelp home page GithubHelp logo

Comments (3)

LiamBindle avatar LiamBindle commented on May 27, 2024

Hi Andrew, thanks for opening the issue. You bring up a good point—I don't think partially sent messages are continued properly by subsequent mqtt_sync() calls.

Partially sent messages

That being said, I don't think I'd consider this a bug, just because MQTT-C doesn't claim to support such a feature. The mqtt_pal_sendall() function is supposed to send everything in the send buffer, otherwise return an error.

That being said, I think this would be a good feature! And I'd be more than happy to merge a PR with this feature if you're interested in implementing it!

The PAL

Regarding the PAL, the PAL is intentionally simple. The PAL in mqtt_pal.c is meant to be used as a starting point for porting/improving to make your own PAL, so it's meant to be as simple and easy to understand as possible.

A conditional that checks EWOULDBLOCK/EAGAIN to continue the while loop rather than return a socket error would be a good update though, and I'd be happy to merge a PR!

from mqtt-c.

andrewchambers avatar andrewchambers commented on May 27, 2024

Thanks for the reply, I think I had assumed the code was meant to work with non blocking sockets, but I can see that was just an assumption on my part.

I imagine not too much is needed to implement such a feature, but I don't have a need as in the end I used redis pubsub instead of mqtt.

thanks again for the answer though. This is a great project.

from mqtt-c.

LiamBindle avatar LiamBindle commented on May 27, 2024

Fair enough. Thanks for bringing this to my attention.

Cheers,

Liam

from mqtt-c.

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.