CST 415 – Assignment 4


Category: You will Instantly receive a download link for .zip solution file upon Payment


5/5 - (1 vote)

Enhance the Simple Document (SD) server from Assignment 3, using ONE of the following:

  1. .NET System.Net. with C# on Windows
  2. Win32 winsock2 with C++ on Windows (extra credit)
  3. UNIX sockets with C++ on UNIX (extra credit)


Add a Simple Document Browser (SD Browser), using ONE of the following:

  1. .NET System.Net. with C# on Windows
  2. Win32 winsock2 with C++ on Windows (extra credit)
  3. Any mobile development platform (extra credit)


The service will be used and enhanced along with other assignments this term.

Note: This assignment assumes a working PRS from Assignment 1 and a working FT Server from Assignment 2. Use the instructor’s implementations if necessary.

SD Server Enhancements

The server application should meet the following additional requirements:


Add support for document paths as follows:

  1. If the document name begins with a ‘/’, then the document will be a file path
  2. Otherwise, the document will be a session variable, as in Assignment 3


Paths are relative to the current working directory for the SD Server.  For example, if the SD Server starts with “c:\temp” as it’s current working directory, then the document “/foo/bar.txt” would be the file “c:\temp\foo\bar.txt”.


A GET request for a file will return the contents of the file as it’s response.

A POST request for a file will append the contents of the request to the file, starting on a new line.


Note that the Assignment 3 SD Client should continue to work and it should be possible to GET and POST either files or session variables.


The browser application should meet the following requirements:


The browser must take the following command line arguments:

-prs <PRS IP address>:<PRS port>



When the browser first starts up, it should provide the following UI elements:

  1. Title bar that shows “SD Browser” initially
  2. Single line text box, called Address, that is empty initially
  3. A Go button
  4. Multi-line text box, called Content, that is empty initially


When the user clicks the Go button, the browser should connect to the server referenced in the Address field and request the named resource as follows…


Address format:

<type>:<server IP>:<resource>


<type> is one of “SD” and “FT”

<server IP> is the IP address of the server to contact

<resource> is the name of the resource to request from the server


Based on the <type>, the Browser should use the correct protocol and interpret the response appropriately.  The response should then be shown in the the Content text box.


For “SD” type, the document content is shown in the Content.


For “FT” type, the contents of the retrived files are shown in the Content, each file’s text preceded by the file’s name and followed by a blank line.


Example addresses:

SD:                    Retrieves session variable foo

SD:        Retrieves file .\foo\bar.txt from the SD server

FT:                     Retrieves files in the folder .\foo\ on the FT server


See screen shots below for examples from the handout solution.


Note:  For SD type addresses, the browser should open a session for each SDServer the user enters into the address bar. After retrieving the requested content, the browser should close the connection. If the browser requests content again from the same SDServer, the browser should resume the previous session.  The browser should close all open sessions when the browser itself closes.


See “CST 415 – Assignment 4 Illustration.pptx” more details and UML design.


Turn in you source code in a zip file called CST415_Assign4_your_name.zip (e.g. “CST415_Assign4_Pete_Myers.zip”. The zip must include source for both client and server.  The instructor should be able to compile, run and verify your program. This means you need to include your Solution/Project or Makefile as appropriate.


Screen Shots

The following screen shots were taken while running PRSServer, FTServer, SDServer and SDBrowser in the “CST 415 – Assignment 4 Handout Pete Solution” zip file attached to this assignment.


First starting SDBrowser…



Retrieving the contents of a directory “foo” from the FTServer…




Retrieving the contents of the hello.txt file from the dir1 folder on the SDServer…