Getting Started

Download CS365_Lab14.zip and unzip it.

You can import it into Eclipse, or unzip on the command line.

Building from the command line:

ant

Running from the command line:

./run.sh Server port

Your Task

Implement a server that

You can use the socket example programs from Lecture 16 as a reference.

Hints

You can implement this server as a “one shot” protocol” where the server reads a single request, sends back a single response, and then closes the connection.

If you have additional time, you can consider adding the following features:

Testing

You can use the telnet program to test the server. For example, if the server is listening on port 10001, then run the command

telnet localhost 10001

to connect to the server. You can type a line of text containing the two numbers to be added. You should see a response containing their sum.