Home Segments Index Top Previous Next

721: Mainline

To set up a socket connection, the server must do the following:

Then, once the server is listening, the client can do the following:

Then, once the client has attempted to establish a connection to the listening server, the server can do the following:

Finally, once the connection is accepted, both the server and client can do the following:

The pointer variables that are assigned to the values returned from calls to fdopen are like the file pointers assigned to the values returned from calls to fopen. You soon see, in the hardcopy version of this book, that a program can read and write to the socket using those pointer variables as arguments to fscanf and fprintf.