| United States-English |
|
|
|
![]() |
SCTP Programmer's Guide: HP-UX 11i v2, HP-UX 11i v3 > Chapter 2 SCTP Socket APIsAPI 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. You can use the getsockopt()() and setsockopt()() system calls to modify the socket options. These system calls set or retrieve socket interface options, or lower-level protocol options. Following is the syntax for the getsockopt()() system call:
where:
Following is the syntax for the setsockopt()() API:
where: SCTP associations being multihomed, certain option parameters include the sockaddr_storage structure to select the peer address to which the option must be applied. For a one-to-many style socket, applications can use an association ID (sctp_assoc_t structure) to identify the association instance that is affected by the option. Applications must set this association ID while using a one-to-many API style socket. In the case of one-to-one style socket APIs and the branched off one-to-many style sockets, SCTP ignores this association ID parameter. In the case of the one-to-many style APIs, the socket options are applied to all associations that belong to a socket. For a one-to-one API, the socket options apply to all peer addresses of the association controlled by the socket. In the SCTP stack, the getsockopt()() is read-only. This means that applications cannot specify any information in the getsockopt()() call. As a result, applications must use the sctp_opt_info()() API to pass information both into and out of the SCTP stack. Following is the syntax for the sctp_opt_info()() API:
where:
The sctp_opt_info()() API returns 0 on success, and returns -1 on failure. It sets errno to the appropriate error code. The sctp_opt_info()() call is a replacement for getsockopt()(), and sctp_opt_info()() does not set any option associated with the specified socket. You must use the setsockopt()() call to set any writeable option, such as SO_LINGER and SCTP_NODELAY. |
||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||