Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Network & Security Expert

Program One - Multithreaded Joke Server and Client

Overview:

In this assignment you will build a pair of multi-threaded servers that accept input from multiple clients, and return appropriate output. In addition to the basic client-server model, you will also implement a secondary administration channel to your servers, and manually maintain the state of all conversations within your distributed application.

Each aspect of the specifications requires you to solve a particular client-server problem while maintaining a conversation within a stateless protocol. The assignment is designed to give you general-purpose exposure to writing code for a client-server environment, and working with threads, neither of which is trivial.

Your finished server is just for fun, but with minor changes it can serve as the basis for a real, viable, client-server application handling thousands of client conversations simultaneously.

Note that we will not make these servers thread-safe which is beyond the scope of this assignment.

InetServer:

Install Java 1.8 if you need to. We will be running your programs under Java 1.8.

You will need several command windows (shells), each running a separate process to run your client/server programs. Command windows are available under Windows by using [Start | run | cmd]. Use [Start] within the original command shell to start other windows. Under Unix (and Apple OSX which runs on top of Unix) use command shells [Terminal Windows] of your choosing.

Refer to the InetServer PDF document, and the lecture, for large hints on how to get this program working. The expectation is that you will TYPE IN THE CODE YOURSELF, and GET IT RUNNING. In my experience, the 30-40 minutes to type in the programs yourself, fix the bugs you have introduced, and figure out how they run, will be paid back many times over.

Remove ALL of my comments from InetServer.java and InetClient.java. Add extensive comments of your own demonstrating that you know how the server works. This is a required part of this pedagogical assignment, demonstrating that you understand the code.

Some sample Java Inet .class files and source code are available to help you get started. (These work fine under Java 1.8). Run the client/server program as follows: Download ALL the .class files into a directory. Issue [> Java InetServer] in one of the windows, and [> Java InetClient] in a separate window for each client that you will be running simultaneously.

Running the InetServer: In one command window issue: [> java InetServer]. In another command window issue: [> java InetClient] Then follow the prompts on the client to look up the IP addresses of domain-named computers. Optionally, you can run the program on two different machines, exactly the same way, but by starting the client with the name or IP address of the server machine as the first argument to the InetClient program.

You may have to speak to your firewall about allowing the client/server TCP/IP connections, depending on how it is configured.

Note: The application code in the server-looking up the IP addresses corresponding to domain names-is not particularly interesting to us and was just some fun network code using existing libraries. The client and server portion of the assignment is what we care about. The assignment would be almost as interesting if we simply sent two numbers from the client to the server and had the server add them together.

Submission files for Inet:
InetServer.java
InetClient.java.

Zip these two java source files together and submit to the InetServer D2L link.

Concatenate your two Inet files together and submit your InetAll file to the InetTII link as .docx, .html, or .txt. NO ZIP FILES HERE.

Run the plagiarism checker against your InetTII link by clicking on the D2L number representing the number of InetTII submissions you have made, and following the links. In this case only, your code will likely appears as being flagged for plagiarism (because all of the code is the same as other submissions), but none of your comments should be flagged for plagiarism.

Execution:

Run your sever with multiple clients active at the same time. Interleave requests from different clients. Capture eight output responses from one client in joke mode, and eight in proverb mode, showing that the jokes and proverbs are returned randomly, but not repeated until all four in each set have been sent back. Annotate this in your output log.

Repeat the process, but this time use your adminstration client to interleave Joke Mode and Proverb Mode, showing that state is correctly maintained across changes between modes.

Put the output from your running sessions in a text log file and ANNOTATE the output-highlighting the randomness of the jokes, the interleaving of modes, etc. Do NOT change any of the output data, but you can add some white space to make it easier to read if you like.

Format the presentation and submission of your work exactly as specified.

Attachment:- java.rar

Computer Network & Security, Computer Science

  • Category:- Computer Network & Security
  • Reference No.:- M91967840

Have any Question?


Related Questions in Computer Network & Security

Lab activity investigate system backup and restore

Lab Activity: Investigate System Backup and Restore Tools Purpose: Assess and Document Tools to Backup and Restore the System Hard Drive for a Windows 8.1 Workstation. - Assess and document the use of a system backup too ...

1srin response to nmap -n -sn localhost what kind of

1. SR In response to "nmap -n -sn localhost": What kind of information did the nmap scan results show you, specifically? 2. FIB What does the "-sn" option do in nmap? ping scan -disable port scan 3. SR How does the "-sn" ...

Question 1 for rsa encryption we need a modulus that is the

Question : 1. For RSA encryption we need a modulus that is the product of two prime numbers, p and q. Assume p = 11 and q = 13, and thus n = p*q = 143. In this case, the RSA encryption exponent e must be relatively prime ...

Content analysis assignmentoverviewthis assignment has

Content Analysis Assignment Overview This assignment has three major aims: - To help students gain good understanding of all ITECH1102 theoretical and practical material. - To encourage students to use content analysis s ...

Wireless sensor networks wsn let users to access servers

Wireless Sensor Networks (WSN) let users to access servers, printers, and other network resources regardless of their location, within the wireless reach. This flexibility means that, for example, a user's laptop stays c ...

With smaller companies saving thousands and larger

With smaller companies saving thousands and larger companies saving billions through flexible manufacturing, if you are a discrete parts manufacturer seeking to be more lean, it is important to consider whether this migh ...

Suppose that serendipity bank has excess reserves of 12000

Suppose that Serendipity Bank has excess reserves of $12,000 and check able deposits of $150,000. If the reserve ratio is 20 percent, what is the size of the bank's actual reserves?

In a short paragraph explain the transmission of data for a

In a short paragraph, explain the transmission of data for a TCP connection between a client computer and a web server to request a web page. Assume that the server responds with a web page that fits in one packet. Assum ...

Question 12326 packet tracer - configuring pap and chap

Question 1 2.3.2.6 Packet Tracer - Configuring PAP and CHAP Authentication Submit your answer as Q1.pka Question 2 2.5.1.2 Packet Tracer - Skills Integration Challenge Submit your answer as Q2.pka Question 3 3.4.2.4 Pack ...

Compare the importance of three categories described in the

Compare the importance of three categories described in the article: 1. window of exposure, 2. full public disclosure, 3. reasonable disclosure for three types of software applications: 4. military, 5. medical, 6. educat ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As