Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[mosquitto-dev] Feature: publishing multiple independent buffers, concatenated together.

Hi all,

I have made a PR to support the following feature: A new publishing function (named publishm or  publishv, haven't decided to use which one yet) which allows a message payload to be constructed from multiple independent buffers, concatenated together.  

Motivation: Using this method is faster and has less memory footprint as compared to calling mosquitto_publish multiple times(this is discussed here). The memory footprint is smaller because the user can avoid creating their own big buffer, i.e saving the cost of calling memcpy on their own end .

From an implementation perspective, I had the following concern: Would we want to use iovec (present in <sys/uio.h>, but not supported by all OSs/platforms) or iovec-like struct of our own?

You can see the remaining discussion that has happened on the PR.

Looking forward to some suggestions/feedback regarding this feature and the implementation concern mentioned above.

Sidhant


Back to the top