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 ...