Chapter 10. SCTP Client/Server Example
Introduction
We will now use some of the elementary functions from Chapters 4 and Chapter 9 to write a complete one-to-many SCTP client/server example. Our simple example is similar to the echo server presented in Chapter 5, and performs the following steps:
A client reads a line of text from standard input and sends the line to the server. The line follows the form
[#] text
, where the number in brackets is the SCTP stream number on which the text message should be sent.The server receives the text message from the network, increases the stream number on which the message arrived by one, and sends the text message back to the client on this new stream number.
The client reads the echoed line and prints it on ...
Get The Sockets Networking API: UNIX® Network Programming Volume 1, Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.