Skip to content

optimize publish() #29

@hmueller01

Description

@hmueller01

Is it needed that we copy the payload to the buffer?

// Add payload
for (size_t i = 0; i < plength; i++) {
this->buffer[length++] = payload[i];
}

instead we could just use

write(payload, plength);

and write the header / topic stuff before ... (e.g. by using the beginPublish() function).

This way we could send longer messages without the need to increase the buffer size.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions