Example 4: Write a simple client server program for two processes (Client and Server) to communicate using Unix sockets. Client executes on a machine whose Internet name is beehive.cc.gatech.edu; Server executes on a machine whose Internet name is mit.edu; the port number to use with the socket at the Server is 2999. The sockets use TCP/IP as the underlying protocol for communication. Once connected, the Client sends a string "Hello World! Client is Alive!" On receiving this message, the Server replies with a string "Got it! Server is Alive!" The Client and Server print what they successfully sent as well as what they successfully received, respectively, on stdout, close the connection, and terminate. Code Example: build ----- Tested on Linux Makefile is provided with example codes. simply type 'make' to compile. Make sure to use the right binary output for your target machine. For simplicity, use same target machines for both client and server. For example, a binary file built on x86_64 architecture won't run on the i686 unless you use -m32 option for compatibility. (try 'uname -m' to check out architecture) This Makefile uses -m32 as default to make a life easier. For more help ------------- If you are not sure about any system call, use 'man' for detailed explanation. Not sure about 'man' itself? type 'man man' =) For example, if you want know about socket call, type 'man socket' Default options --------------- server port: 2999 This option can be changed through command line arguments. Server ------ run server (if necessary with different options) e.g. ./server (run with default options) ./server -p 3333 (to set up 3333 as port number) Client ------ run client (if necessary with different options) e.g. ./client -s < host ip | host name > ./client -p 3333 -s helsinki.cc.gatech.edu