SCTP Programmer's Guide
-lxnet Specifies the /usr/lib/libxnet library. This
option indicates that the application program
must use the libraries defined in this library
during compilation.
-lsctp Specifies the libsctp library. This option
indicates that the application program must use
the libraries defined in this library during
compilation.
Example 3-1 Sample Commands to Compile the Server and Client Programs
Consider a server application called srv.c and a client application called cli.c.
You can use the following command to compile the server application:
# cc –o srv -D_XOPEN_SOURCE_EXTENDED srv.c -lxnet –lsctp
You can use the following command to compile the client application:
# cc –o cli -D_XOPEN_SOURCE_EXTENDED cli.c -lxnet –lsctp
Running Sample Applications that use the SCTP APIs
This section discusses how to run the sample applications that are compiled using the
SCTP APIs.
Consider the sample server and client applications listed in Appendix A (page 75) for
one-to-one and one-to-many connections. These sample applications are available in
the /usr/lib/demos/networking/sctp directory.
To run the sample server application, enter the following command:
# ./srv_app <port_number>
where:
srv_app
Specifies the executable file.
port_number
Specifies the port number on which the server accepts connections.
Example 3-2 Sample Command to Run the Server Application
To run the sample server application in a one-to-one or one-to-many connection, enter
the following command:
# ./srv_app 6000
The following output is displayed:
{one-to-one}: Waiting for associations ...
This output denotes that the server is ready to accept connections on port 6000.
To run the sample client application , enter the following command:
70 Compiling and Running Applications that Use the SCTP Socket APIs