Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In this assignment you have to write a mult-threaded web server to serve incoming requests from clients in a computer network. Your web server will
In this assignment you have to write a mult-threaded web server to serve incoming requests from clients in a computer network. Your web server will be implemented using two Java source files and ane directory/folder which contains your website files. The two source files are: - File No. 1: Webrequest.java - File No. 2; WebServer.java File No. 1 is already implemented but File No, 2 is not implemented and should be implemented as part of your tasks in this assignment. In this assignment we have a simple website which bas only one html file. When displayed by a web browser, it should look like the web page shown in Figure-1. (i) Figure-1: Web page stored in the website directory/folder. A5suming an error-prone network, your tasks are: 1. Study the source code written in File No. 1 carefully. 2. Modify the given htm1 file to display your name and registration number. Page 1 of 2 Prepared by: Dr Talal A. Edwan 3. Write a source code for a multi-threaded web serves that utilises the source code in File No. 1. This code (L.e., the multi-threaded web server code) should take two arguments from the user. a) Port number. b) Directory/Folder path and name. 4. Save the source code for the multi-threaded web server in File No. 2. 5. Compile File No. 1 and File No. 2 then run File No. 2 in console (terminal). For example, on GNU/Linux operating system the command is: userecomputer:-s sudo java Webserver port_number/path/to/my/website/folder/ 6. Access the web server from a web browser and observe the web page. 7. Optional: monitor the trunsport-layer states and events using netstat when you access the web server using more than one tab in your web browser. What bappens when there is more than one client request? What states are dispolayed on console/terninal by nets teat? Cor Deliverables: one Java source code (multi-thread code written in File No. 2)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started