Download the source code here. Compile it in your virtual machine gcc -g echo.c. Start the echo server process by typing
./a.out -sLaunch an echo client by typing
./a.outBy default, the client connects to the echo server runninging on localhost (127.0.0.0.1) at port 9999.
Exercise 1: While one client is actively connected to the server, start another client (in a different terminal) and observe what happens. Can you explain why?
Exercise 2: Modify the server program's implementation to handle concurrent client connections. (Hint: you may want to use the fork system call and the overall modification shouldn't require more than a few lines of code.)