All the assignments are simple enough to fit a single (flat)
directory, so your TAR (or ZIP) file should not contain directories.
You should include a Makefile or a README file or both. If you use
non-standard libraries make sure to include them in your package and
indicate the appropriate environment settings (e.g.,
LD_LIBRARY_PATH) in your README
or Makefile. Unless explicitly specified, everything should work in a
Create a chatroom system composed of a server component and a client component. Each user participates in a chatroom conversation with other users by connecting his/her client component to the chatroom server. The communication between a client and the server is implemented through a TCP/IP socket.
The chatroom client works within a normal terminal shell. It reads user's input, line by line, and sends each line of text to the chatroom server. The client also reads lines from the server and prints them on the terminal. The client reads and prints messages from the server asynchronously, that is, independently of user's input.
The chatroom server accepts connections from clients. Multiple clients can be connected to the server at the same time. The server reads lines of text coming from each client's connection and forwards them to every other client. The server forwards client messages as they come in. This means that if a client, say client A, sends a message, the server should not block waiting for another client (B) to produce text before forwarding A's message.
select()can be used from the C/C++ language to select input from multiple sources. See the
Create an application
httpfetch that retrieves documents
accessible through HTTP.
httpfetch takes a list of URLs
as parameters, possibly with some selection parameters and an HTTP
httpfetch downloads and saves into the
current working directory every document that matches the selection
criteria. The selection parameters specify a maximum length and/or a
specific MIME type. If no selection parameters are specified,
httpfetch downloads the documents associated with every
URL passed to it. The syntax of command-line parameters is as follows
(parameters in square brackets are optional):
httpfetch [-proxy URL] [-maxlen num] [-type type] URL [URL ...]
httpfetchuses URL as its HTTP proxy for every HTTP request.
httpfetchdownloads only those documents whose
Content-Lengthis less than or equal to num.
httpfetchdownloads only those documents with a
Any error reply must be reported to the user. It is not required that
httpfetch be able to handle the full HTTP protocol. In
particular, it is not necessary that
redirection replies (status 3xx). Replies that are not handled or
unknown replies must be reported to the user just like error replies.
httpfetchis meant to access documents through HTTP only, therefore it does not need to understand any URL schema other than
http:. In other words, you don't have to parse
ftp:or other classes of URLs.
Create a DTD specification for an XML database of musical compact discs. The database consists of album entries. Each album consists of one or more CDs. An album has attributes including author, performer, title, publisher, year, total playing time, etc. Each CD has a set of tracks, each one carrying information such as title, author, performer, playing time, etc. When a track doesn't specify an author or a performer, that track implicitly inherits their values from the album specification. Some tracks may be further divided into movements. The DTD must be sufficiently expressive to model the CDs of this informally structured list.
Rewrite the information contained in the list using the XML format that you
defined (this can be done by hand) and create a program
xmlcd to read and query such XML
xmlcd. The syntax for
xmlcd [-author name] fileIf you do not specify the
xmlcdreads file and prints its content in some reasonable plain-text format (see list). If
-authorname is specified, then
xmlcdprints only the tracks authored by name.
Create a virtual auction system using Siena. The virtual auction works very much like a real auction in which sellers present items, with a description and possibly with a starting price, and buyers make their bids. There is no arbiter in this auction, therefore it is the responsibility of sellers to decide when to close the deal and start the monetary transaction with the buyer. Buyers can limit the validity of their bids by specifying a time-out.
The system consists of a
seller program and a
buyer program. Sellers use the
seller = "Joe" item = "s21kj-77-1" category = "music/instruments/guitars" maker = "Paul Reed Smith" model = "Custom" color = "tan" top = "maple" body = "mahogany" year = 1991 conditions = "excellent" price = 3200a buyer might then express interest in something like this:
category = "music/instruments/guitars" maker = "Fender" model = "Telecaster" year < 1970 price < 1500after receiving and evaluating some notifications, the buyer might make an offer like this:
buyer = "Foo" seller = "Joe" item = "314159265" offer = 2150 expires = "Mar 1 2000"at any time, the seller might decide to close the deal on an item with any one of the bidders. To do that, the seller contacts the buyer and sends out an announcement that that item is not available any longer:
seller = "Joe" item = "314159265" closedIt is not required that every communication occur through Siena. For example, in closing the deal, buyers and sellers might exchange e-mail or simply use the telephone. For the purposes of this assignment, we will assume that when the seller closes the auction, the process is finished as far as Siena is concerned.