NAME

coreNetChanPayloadMsg() -- create a network channel payload message


SYNOPSIS

include "appcore.h"

int coreNetChanPayloadMsg( size_t l, unsigned char* p, coreNetAddrSPEC_t* s )


DESCRIPTION

The coreNetChanPayloadMsg() function creates a netCORE payload message of the requested size. If the data buffer p is defined, the buffer is copied into the message. If the data buffer p is NULL, an empty message of the requested size is created. Using the macro, CORE_MSG_PAYLOAD(), the user can then access the message payload directly. Creating a message up front is the preferred method, as it avoids an extra copy of your data into the message.

Using the channel handle, the payload in this message is transmitted on the channel by the coreMsgDispatch() function.


PARAMETERS

l
   Payload size in bytes
p
   Pointer to payload buffer
s
   To address, used only if channel is UDP or multicast.


RETURN VALUE

errno ValueCondition
ENOTSUPNot supported - netCORE not running.
EINVALPayload length zero.
ENOMEMOut of memory

MULTI-THREAD SAFETY LEVEL

MT-safe.


SEE ALSO

Functions:
coreNetServerPortAdd() coreNetServerPortRemove() coreNetChanAccept() coreNetChanReject() coreNetChanConnect() coreNetChanOpen() coreNetChanClose() coreNetChanPayloadMsg() coreNetChanTxFlow() coreNetChanRxFlow() coreNetAddrInit()