home
topology files
command‑line options
the core API
FAQ
download and install
|
cnet's Application Programming Interface
- NAME
- CNET_read_application - obtain a new message to be delivered
- SYNOPSIS
-
#include <cnet.h>
int CNET_read_application(CnetAddr *destaddr, void *message, size_t *length);
- DESCRIPTION
-
CNET_read_application requests that the next message for delivery
be copied into the provided message buffer.
CNET_read_application should only be called as the result of
receiving an EV_APPLICATIONREADY event.
On invocation, length must point to an integer indicating the
maximum number of bytes that may be copied into message .
On return,
the network address of the required destination node
will have been copied into destaddr ,
the new message will have been copied into message ,
and
the location pointed to by length will contain the number
of bytes copied into message .
- RETURN VALUE
-
The value
0 is returned on success.
On failure, the value -1 is returned,
and the global variable cnet_errno is set to one of the
following values to describe the error:
ER_BADARG
- Any of
destaddr , message or length
is an invalid pointer.
ER_BADSIZE
- The value pointed to by
length is too short to receive
the new message.
ER_NOTREADY
- The Application Layer does not have a new message for delivery.
ER_NOTSUPPORTED
- The current node does not have an Application Layer.
- SEE ALSO
-
CNET_write_application
|