This recipe will show you how to connect two programs by using a connection-oriented mechanism. This recipe will use TCP/IP, which is the de facto standard on the internet. So far, we've learned that TCP/IP is a reliable form of communication, and its connection is made in three phases. It is time now to write a program to learn how to make two programs communicate with each other. Although the language used will be C++, the communication part will be written using the Linux system calls, as it is not supported by the C++ standard library.
Learning to use TCP/IP to communicate with processes on another machine
How to do it...
We'll develop two programs, a client and a server. The server will start...