SCTP Programmer's Guide
descriptor open, so that the receiving endpoint can receive data that SCTP was unable
to deliver.
The sendmsg() and recvmsg() Socket APIs
Applications use the sendmsg() and recvmsg() socket APIs to transmit data to and
receive data from its peer.
Following is the syntax for the sendmsg() and recvmsg() socket APIs:
ssize_t sendmsg(int sd, const struct msghdr *message, int flags);
ssize_t recvmsg(int sd, struct msghdr *message, int flags);
where:
sd
Represents the socket descriptor of the endpoint.
message Specifies the pointer to the msghdr structure that contains a single user
message and the ancillary data. Following is the structure for the msghdr
structure:
struct msghdr {
void *msg_name;
socklen_t msg_namelen;
struct iovec *msg_iov;
size_t msg_iovlen;
void *msg_control;
socklen_t msg_controllen;
int msg_flags;
};
where:
msg_name
Specifies the pointer to the socket address structure.
msg_namelen
Specifies the size of the socket address structure.
msg_iov
Includes an array of message buffers.
msg_iovlen Specifies the number of elements in the msg_iov
structure.
msg_control
Specifies the ancillary data.
msg_controllen
Specifies the length of the ancillary data buffer.
msg_flags
Specifies the flags on the received message.
For more information on the msghdr, see RFC 2292 (Advanced Sockets API
for IPv6).
flags
Contains flags that affect the messages being sent or received
Different Socket API Styles 47