SCTP Programmer's Guide
Basic One-to-One Call Flow Sequence
A one-to-one style SCTP application uses the following system call sequence to prepare
an SCTP endpoint for servicing requests:
1. socket()
2. bind() or sctp_bindx()
3. sctp_getladdrs()
4. sctp_freeladdrs
5. listen()
6. accept()
When a client sends a connection request to the server, the accept() call returns
with a new socket descriptor. The server then uses the new socket descriptor to
communicate with the client, using recv() and send() calls to receive requests
and send responses.
7. sctp_getpaddrs()
8. sctp_freepaddrs
9. recv() or recvmsg()
10. send() or sctp_sendx() or sctp_send()
11. close() terminates the association.
An SCTP client uses the following system call sequence to set up an association with
a server to request services:
1. socket()
2. connect() or sctp_connectx()
After returning from connect(), the client uses send() and recv() calls to
send out requests and receive responses from the server.
3. The client calls close() to terminate this association when .
For more information about the one-to-one style socket calls, see“Common Socket
Calls” (page 54).
The socket() Socket API
Applications call socket() to create a socket descriptor, to represent an SCTP endpoint.
Following is the syntax for the socket() socket API:
int socket(PF_INET, SOCK_STREAM, IPPROTO_SCTP);
or
int socket(PF_INET6, SOCK_STREAM, IPPROTO_SCTP);
where:
PF_INET
Specifies the IPv4 domain.
PF_INET6
Specifies the IPv6 domain.
Different Socket API Styles 43