next up previous
Next: A proxy server Up: Assignment 3: The Socket Previous: Assignment 3: The Socket

Java Sockets

First, read Section 1.3 of the textbook. Then go to the following web page and read the tutorial about the Java socket object.

http://java.sun.com/docs/books/tutorial/networking/sockets/

  1. Go to your favorite Java development environment and create programs named KnockKnockClient and KnockKnockServer. You can pick up the code from the links in the tutorial or from

    http://rocky.wellesley.edu/cs349/code/hw03/
    You will also have to pick up the file KnockKnockProtocol.java, although you might want to make that an internal class for KnockKnockServer.
  2. Compile the two programs and run them according to the instructions in the tutorial. Don't forget that you will have to change the name of the host where the client goes looking for a server. This means you have to know the name of the machine where you are running the program. If you don't know, and you don't know how to find out, ask me. Enjoy the delightful knock-knock jokes!
  3. You might also want to try running the multi-threaded version of the server. I have it running on rocky, so you can connect your client to the server there if you want to.



Allen Downey
Tue Sep 12 11:58:47 EDT 2000