Question: First, get the code from the zip file working on your machine. If you can, work with someone else ( or with two machines )
First, get the code from the zip file working on your machine. If you can, work with someone else or with two machines and see if you can get the
client to run on one box and communicate with the server on another. In your PDF assume that you have deployed the client and server to two
separate nodes machines
Use diagrams to communicate the three kinds of structures involved in your clientserver system that tells knockknock jokes.
Create a diagram for each of the three structure types in the definition of software architecture see figures
You can use any tool that supports UML, like lucidchart, Visio,
draw.io etc.
Upload a single PDF document.import
java.io;
import
java.net.;
public class KnockKnockClient
Run Debug
public static void mainString args throws IOException
Socket kkSocket null;
PrintWriter out null;
BufferedReader in null;
kkSocket new Socket host:"taranis", port:;
out new PrintWriterkkSocketgetOutputStream autoFlush:true;
in new BufferedReadernew InputStreamReaderkkSocketgetInputStream;
catch UnknownHostException e
System.err.printlnx:"Don't know about host: taranis.";
System. exit status:;
catch IOException e
System.err.printlnx:"Couldn't get I for the connection to: taranis.";
System. exit status:;
BufferedReader stdIn new BufferedReadernew InputStreamReader
System.in;
String fromServer;
String fromUser;
while fromServer in readLine null
System. out.printlnServer: fromServer;
if fromServerequals anObject:"Bye."
break;
fromUser stdIn. readLine ;
if fromUser null
System. out.printlnClient: fromUser;
out.print fromUser;
out. close;
in close;
stdin. close;
kkSocket.close;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
