Using the Receive Buffer as a Reply Buffer

Updated: April 19, 2023
When building a response to a client request, you often need a temporary buffer in which to build this response. Using the receive buffer, ctp->msg, can be a convenient choice because:
The ctp->msg buffer has ctp->msg_max_size bytes of space available in which to build this response. The default value is a bit more than 2KiB. If you find you need more, you can configure a larger receive buffer at initialization by setting the msg_max_size field in the resmgr_attr_t structure given to resmgr_attach().
Note: When you're handling parts of combine messages that are not the last part of the message (i.e., when ctp->rcvid == 0), you are not allowed to reply, and should not touch the receive buffer at all.
While using the receive buffer as your reply buffer, you should: