###############################################################################
##
## README
##
###############################################################################

---- Description ----

This project consists of two small applications that, together, constitute a
client-server pair that are designed to interact with each other.


---- Compilation (w/ OMake) ----

To compile and build these applications, just run the command "omake" in the 
root directory of the project source. This command should invoke the compiler
and produce two executables: "simple_server" and "simple_client".

To clean the build directory, removing all executables and intermediate files,
run "omake clean" (or, optionally, "omake realclean").


---- Compilation (w/out OMake) ----

If you happen to be on a system without OMake installed (available from
http://omake.metaprl.org), you can compile the code by hand by issuing the 
following commands:

    gcc -Wall -I. -o simple_server simple_server.c
    gcc -Wall -I. -o simple_client simple_client.c

As with the compilation using OMake, this should produce two executables:
"simple_server" and "simple_client".


---- Running ----

To test the client-server pair, invoke the "simple_server" and "simple_client"
applications, passing them both the same IP-port pair; this IP address should be
a valid address of one of the network interfaces on the server, and the port
can be any free port on the machine (i.e. 12345).


---- Example run ----

For this example, we will use a single machine and the loopback address:

    Open up two terminals; we'll call them A and B.
    "cd" to the project directory in both terminals
    Run the following command in terminal A: "./simple_server 127.0.0.1 12345"
    Run the following command in terminal B: "./simple_client 127.0.0.1 12345"
    
The output should look something like this for the server:

    Getting listen address...
    Creating TCP socket...
    Binding to address...
    Set the socket to listen for incoming connections...
    Waiting to accept pending request...
    Waiting for data to read...
    Sending response...

And something like this for the client:

    Getting server address...
    Creating TCP socket...
    Connecting to the server...
    Writing some data...
    Reading the response...
    Q: What is the answer to life, the universe, and everything?
    
    A: 42


