2.0 Updates:
  1. 2023-03-24: Note—this program has been modified to compile from a single source code file. Let me know if you discover bugs.

CSC435 Distributed Systems
Color Server

Professor Clark Elliott

Copyright (c) 2023 by Dr. Clark Elliott with all rights reserved.

Overview:

This is our first exercise in writing a multi-process, multi-threaded client/server system. TYPE IN the Client/Server program (unless you are well familiar with Java network programming), get the two (or more) processes running, and add your own comments. Submit to D2L. Use this Client/Server system as a model for the more advanced distributed programs this quarter.

Administration:

  • Color Server Checklist ←Download, complete and submit to D2L along with your .java source code (renamed as .java.txt).

  • Submission files required (precisely named):
    
    ColorServer.java.txt ←Exact copy of ColorServer.java, but renamed.
    ColorChecklist.html
    

  • Test the provided TII plagiarism checker: Run the plagiarism checker against your Colorser er.java.txt link by clicking on the D2L number representing the number of ColorServer submissions you have made, and following the links. If you don't get a plagiriasm report, then add a line or two at the top and the bottom of your .java source code and try again.

    In this case only, your code will likely appears as being flagged for plagiarism (because all of the code is copied from my original work). But none of your explanatory comments should be flagged for plagiarism because you have written them yourself. (In this assignment only we are simply learning how the plagiarism checker works.)

Grading:

  • Did you add sufficient explanatory, pedagogical comments to the code?

  • Did you follow the assignment steps listed in this web page?

  • Do you have a correct course header for java programs?

  • Did you complete all of the items in the checklist?

  • Were you successful in all of the administration steps to submit your work, correctly named, with a TII similarity report generated, on time to D2L?

The assignment:

The downloadable source code:

ColorServer.java

  1. Read through this assignment page and the ColorServer checklist.

  2. Create a development directory for ColorServer.

  3. Download the ColorServer.java file.

  4. Scan through the code for both processes to get a feel for what they do. Read all the comments.

  5. Adjust your JDK version to one that is compatible with the class standard version this quarter.

  6. Compile the .java file (you may have to issue "javac *.java" twice to pick up all four classes).

  7. Start the server in one terminal window, and one client in another terminal window. [In window one: java ColorServer. In window two: java ColorClient.]

  8. Play with the system to make sure you know how it works. If you use an IDE you may have to figure out how to run multi-process programs under it.

  9. Run again, but this time with more than one client at the same time. Use a different Username for each client.

  10. Engage in discussion with your peers on the D2L ColorServer discussion forum about this code: your comments, questions, replies and annotated links. Two postings are REQUIRED.

  11. If you have a second monitor, bring the .java code up on it. Otherwise print the client/server program out.

  12. Unless you are already a competent network java programer TYPE IN the program yourself. We want all the code and comments to go in through your eyes, be processed by your brain as precise symbols of thought, reformatted as language (including both written and spoken versions), translated into motor actions, and entered into the visual language symbols of Java through your fingers. In the background you will engage in algorithmic, big-picture thinking whether you want to or not. Get the [two] client and server programs compiling and running a little bit at a time. As long as the programs run the same, you are free to (and encouraged to) make small changes in the code as you wish. Always keep the programs running. You'll have to diagnose your mistakes, and you'll make small changes along the way. VERY HIGHLY RECOMMENDED.

  13. Remove my comments (except the "Thanks" URLs) and ADD YOUR OWN EXPLANATORY COMMENTS about how the programs work. REQUIRED, graded.

  14. Add the required class header for java files, including, e.g., java version, your name and the date.

  15. Insert your required two discussion postings (or more) as java comments at the bottom of your ColorServer.java file.

  16. Make small changes and additions to the program functionality as your creative spirit wishes. Explain the modifications at the bottom of the checklist.

  17. Make sure that your code all compiles from the command line with "javac *.java" (possibly executed twice). This is how we will compile and grade all your assignments.

  18. Remove all "package" statements from your java code. We will not compile with packages and will not look for your code in subdirectories.

  19. Read and follow ALL of the D2L submission specifications for this class. See the class web page.

  20. Complete the ColorServer checklist. Note: making false claims on a checklist is an academic integrity violation.

  21. Once you have completed your programming and commenting tasks, and fully verified that your .java code is compiling and running, copy your ColorServer.java program to ColorServer.java.txt and submit the .txt file to D2L.

  22. Submit your ColorChecklist.html file to D2L. NEVER make false claims in your checklist—NEVER say YES for any work that was not done. This would be a serious academic integrity violation.

  23. SUGGESTED: Download, compile and run your .java.txt code from D2L to make sure it has not been corrupted. It is always your responsibility to ensure the file has not been damaged during upload. There is no "re-upload" after the assignment deadline.

  24. Your TII report will be heavily flagged for plagiarism, which FOR THIS ASSIGNMENT ONLY is fine, because you have copied my code. Your comments should be original however, and not heavily flagged.

  25. Congratulate yourself on completing the assignment as a Java Network Programmer.

Notes:

  1. You may wish to run the ipconfig (Windows) or ifconfig (Mac / unix) to find our your real IP address. NOT REQUIRED.

  2. If you want to run between computers on your local home network, you may have to adjust the firewall in your router to allow access to your color server from over your home network. NOT REQUIRED.

  3. If you are clever, and depending on what your ISP will allow, you may be able to set up your local home router to accept incoming Internet Color Client connections from anywhere in the world. However if you do this, BE CAREFUL, because you will also be giving hackers from all over the world access to the computers on your local network. See the later lecture on Network Address Translation (NAT) to get started. NOT REQUIRED.

  4. If you later have trouble completing the much more challenging multi-threaded server assignment, the first question we will always ask is, "Did you TYPE IN the ColorServer Java code yourself?"