Getting Started

Download CS365_Lab13.zip and unzip it.

You will edit the code in arithmetic_server.c.

Your Task

Write a server that

You can use the socket example programs from Lecture 15 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.