SCTP Programmer's Guide
The sctp_recvmsg() SCTP Socket API
Applications can use the sctp_recvmsg() SCTP socket API to receive messages. This
API is similar to the recvmsg() API, with the SCTP_SNDRCV option. For the
sctp_sndrcvinfo structure to be populated by sctp_recvmsg(), an application
must enable the sctp_data_io_events with the SCTP_EVENTS option.
Following is the syntax for the sctp_recvmsg() socket API:
ssize_t sctp_recvmsg(int sd,
void *msg,
size_t len,
struct sockaddr *from,
socklen_t *fromlen
struct sctp_sndrcvinfo *sinfo
int *msg_flags)
where:
sd
Specifies the socket descriptor.
msg
Specifies a message buffer.
len
Specifies the length of the message buffer.
from
Specifies the sender of a message.
fromlen
Specifies the length of the address.
sinfo Denotes a pointer to an sctp_sndrcvinfo structure that is filled after
the message is received.
msg_flags
Denotes a pointer to an integer to be filled with a message flag.
The sctp_connectx() SCTP Socket API
Applications can use the sctp_connectx() SCTP socket API to associate to an
endpoint that is multihomed. This API enables an application to specify multiple
addresses on which a peer can be reached. This API only specifies that the SCTP will
try to make use of all the addresses in the list when required.
Following is the syntax for the sctp_connectx() SCTP socket API:
int sctp_connectx(int sd,
struct sockaddr *addrs,
int addrcnt)
where:
sd
Specifies the socket descriptor.
addrs
Specifies an array of addresses.
addrcnt
Specifies the number of addresses in the array.
The list of addresses passed to sctp_connectx() is used only for setting up the
association and does not specify the set of addresses the peer uses for the resulting
association. If applications want to find out the set of peer addresses, applications must
use the sctp_getpaddrs() to retrieve them after the association is set up.
SCTP-Specific Socket APIs 65