SCTP Programmer's Guide

The close() Socket API
Applications use close() to gracefully shutdown all the associations represented by
a one-to-many style socket.
Following is the syntax for the close() socket API:
close(int sd);
where:
sd
Specifies the socket descriptor of the associations to be closed.
To gracefully shutdown a specific association that is represented by the one-to-many
style socket, an application must use the sendmsg() call and include the MSG_EOF
flag. A user can optionally terminate an association non-gracefully by sending the
MSG_ABORT flag, and possibly by passing a user specified abort code in the data field.
Both the flags, MSG_EOF and MSG_ABORT, are passed with ancillary data in the
sendmsg() call.
If sd in the close() call is a branched-off socket that represents only one association,
the shutdown is performed only on that association.
The connect() Socket API
An application can use the connect() call in the one-to-many style to initiate an
association without sending data.
Following is the syntax for the connect() socket API:
connect(int sd, const struct sockaddr *nam, socklen_t len);
where:
sd
Specifies the socket descriptor for a new association.
len
Specifies the size of the address.
Multiple connect() calls can be made on the same socket to create multiple
associations. In UDP, a connect() call cannot make multiple associations on the same
socket.
API Options to Modify Socket Behavior
This section describes the APIs that include options to modify the socket behavior.
SCTP provides many socket options to modify options that are associated with a socket.
These socket options can enable or disable certain functions to facilitate applications
to control the transport of data.
If you modify a socket option, you must specify the level to which the option belongs.
The level indicates whether the option applies to the socket interface, or to a lower-level
communications protocol interface, such as IP, TCP, or SCTP.
52 SCTP Socket APIs