Assignment 6: Networking and Files - Due Monday, July 21th

In this assignment, we will create a simple Threaded Network Server, a Message of the Day Server.
  1. Create A Server using a TCP Server Socket that listens on a port of your choosing (make it > 1024, or it might have a problem running on copland or strauss).
  2. This server should listen on that port and wait for a connection. It should then connect and continue listening for other connections. It should then wait for incoming data. There will be three possible inputs.
    1. SET text - The SET command, followed by an arbitrary length String terminated with a Carriage Return. It should have this string internally somehow (appending it to a File is fine). It should then close the connection.
    2. GET - The GET command, followed by a Carriage Return, should return 1 random line that was previously entered with the SET command, and close the connection.
    3. GET ALL - The GET ALL command, followed by a Carriage Return should return every line entered, and close the connection.
  3. Again, this should be MultiThreaded - it should be able to handle multiple connections simulataniously.
  4. Extra Credit 0-10%: Make this do something fancy. Point it out to me in the script. Add a feature. Be creative. Have fun. Impress me.
You can test your server by running it on your machine, then telnetting to the loopback address (or your machine's address) and port number, and trying it out.