CSc 423 Assignment 1

The Word From Abroad

Assigned
Due

Jan 19
45 pts
Jan 31
This is a get-started assignment for using the Cleansocks library. You are to create a simple program which is a client for Quote of the Day protocol, defined in RFC 865. This is testing service, and there's not much too it: When the client connects to a qotd service, the server sends it a short message, then disconnects. Such a server is running on sandbox.mc.edu. The quote service runs on port 17, so, if you have nc installed, you can do this:
[tom@tomslap ~]$ nc sandbox.mc.edu 17 Parents often talk about the younger generation as if they didn't have much of anything to do with it. [tom@tomslap ~]$

This exercise is to build a program using the Cleansocks API which will connect using TCP to port 17 on the indicated server, read the quotation, and print it out, with the small modification of adding two dashes and a space at the front of each line.

[tom@localhost qotd]$ ./qcli5 sandbox.mc.edu -- Some people carve careers, others chisel them. [tom@localhost qotd]$ ./qcli5 sandbox.mc.edu -- If opportunity came disguised as temptation, one knock would be enough. [tom@localhost qotd]$ ./qcli5 sandbox.mc.edu -- Any clod can have the facts, but having opinions is an art. -- -- Charles McCabe [tom@localhost qotd]$ ./qcli5 sandbox.mc.edu -- "There was a boy called Eustace Clarence Scrubb, and he almost deserved it." -- -- C. S. Lewis, "The Chronicles of Narnia" [tom@localhost qotd]$ ./qcli5 sandbox.mc.edu -- Envy, n.: -- Wishing you'd been born with an unfair advantage, -- instead of having to try and acquire one. [tom@localhost qotd]$ ./qcli5 sandbox.mc.edu -- Whitehead's Law: -- The obvious answer is always overlooked. [tom@localhost qotd]$ ./qcli5 sandbox.mc.edu -- George Orwell was an optimist. [tom@localhost qotd]$ ./qcli5 sandbox.mc.edu -- If you are good, you will be assigned all the work. If you are real -- good, you will get out of it.
Some quotes are witty, and there are definitely some of the other kind.

Your program should meet the following requirements:

Hints

Submission

When your program is working, nicely commented and properly indented, submit it using the form here.