Skip to main content

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

Sidhant Bansal <sidhbansal@xxxxxxxxx> writes:

> 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?

I don't qutie follow.  Are you actually suggesting using an OS feature
that is not specified by posix and not present everywhere, leading to
this new feature only being available on some platforms, and thus code
that uses it having to do a feature test?  If so, that seems like
madness; mosquitto libs should have a consistent API everywhere, that
usually being a lot of the point of using a library.

If you mean "API to users is the same, and the implementation will
either use a scatter/gather write() call if available or just call write
multiple times if not", so that the mosquitto lib user experience is
uniform, then that seems more or less ok.  If the feature you want is
reasonably widely available, that's one thing, but if it's Linux only I
think we need to understand whether multiple syscalls is worse than a
memcpy.

Or do you mean something else?


This is helpful for looking up POSIX:
  https://pubs.opengroup.org/onlinepubs/9699919799/



Back to the top