SCTP Programmer's Guide

NOTE: If an application calls a send function without user and ancillary data, SCTP
rejects the request with an appropriate error message.
The setsocktopt() and getsockopt() Socket Calls
Applications use the setsockopt() and the getsockopt() calls to set and retrieve
socket options. You can use the socket options to modify the default behavior of the
sockets calls. For information on socket options, see API Options to Modify Socket
Behavior” (page 52).
NOTE: While using the SCTP_ASSOCINFO option to set the maximum number of
retransmissions, the sctp_opt_info() call does not fail if this number is greater than
the sum of all maximum path retransmissions for each remote address. Therefore, the
success or failure of this option does not depend on the number of remote addresses
and whether the association is up.
Following are the syntaxes for the getsockopt() and setsockopt() socket calls,
respectively:
getsockopt(int sd, int level, int optname, void *optval,
socklen_t *optlen);
setsockopt(int sd, int level, int optname, const void *optval,
socklen_t optlen);
where:
sd
Specifies the socket description.
level Specifies the type of protocol. You must set the level to IPPROTO_SCTP
for all SCTP options.
optname
Specifies the option name.
optval
Specifies the buffer to store the value of the option.
optlen
Specifies the size of the buffer (or the length of the option returned).
NOTE: A positive linger time for the SO_LINGER option results in an immediate
termination of the process following the SCTP shutdown.
The read() and write() Socket Calls
Applications use read() and write() socket calls to send and receive data to and
from a peer. These socket calls have the same functionality as the send() and recv()
socket calls, except that the flags parameter is not present in the read() and write()
calls.
If these calls are used in one-to-many style sockets, applications can use these calls only
with branched off socket descriptors.
56 SCTP Socket APIs