nmsg 1.1.2
|
an nmsg_message MUST always have a non-NULL ->np member. More...
#include <private.h>
Public Member Functions | |
ISC_LINK (struct nmsg_dlmod) link | |
Data Fields | |
char * | path |
void * | handle |
an nmsg_message MUST always have a non-NULL ->np member.
it MAY have a non-NULL ->mod member, if the payload corresponds to a known message type.
it MAY have a non-NULL ->message member, if the payload corresponds to a known message type, and the message module implementing that message type is a transparent message module.
nmsg_input generates payloads, and wraps them in an nmsg_message. at this stage the payload ISN'T decoded, because the decoded message may not be used. (e.g., source -> sink traffic.)
nmsg_output, when writing nmsg_messages, needs to synchronize the ->message object (if it is non-NULL) with the ->np object, then detach ->np so that it can be added to the output queue. if the caller wants to reuse the nmsg_message object, he needs to call another function to reinitialize ->np.
note that the ->message field is not filled in (deserialized from ->np) until a function that needs to touch the ->message field is called. if ->message is NULL when nmsg_output_write() is called on a message object, then both ->message and ->np will become NULL and the message object is invalid and should be destroyed.