Question: The application is a KnockKnock joke generator where the client connects to the server and you ask it a KnockKnock joke. The joke protocol goes

The application is a KnockKnock joke generator where the client connects to the server and you ask it a KnockKnock joke. The joke protocol goes like this: Server: "Knock knock!" Client: "Who's there?" Server: "Dexter." Client: "Dexter who?" Server: "Dexter halls with boughs of holly." Client: "Groan."

1. Download the KnockKnockServer.java file from our class Website Knock Knock Server KnockKnockServer.java 2. Copy and paste the client code from the following link. Client code is here: Client Code for Lab. Save it in a file called KnockKnockClient.java Compile the .java files. 3. Open up two windows on your local machine and communicate between client and server using the KnockKnock protocol. In other words, tell jokes between the client and server. Use the command line to start the server: java KnockKnockServer and in the second window, type: java KnockKnockClient 4. Optional, you can change the jokes if you like. 5. If you are in the Lab, you can trade IP addresses with a neighbor and recompile your Client programs. Now one of you start up the server and one start his/her client. Tell jokes between machines. Then, reverse the process and do it again to get the feel of connecting to a Server on a different machine. If you are doing the lab at home, just skip this step.

After getting the chance to try out both the client and server KnockKnock programs, answer the questions below.

Questions .

  1. What happens if you have the wrong IP address of the host where the server is running? Hint: Try it!
  2. How do you look up the IP address of your own machine in Linux?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!