Write a multi-threaded web server

Assignment Help Case Study
Reference no: EM13313759

Operating Systems and Concurrent Programming

Assignment 1

The purpose of this assignment is to write a multi-threaded web server. A start-up program, ass1.c, is available from the course web site. This is a socket server program that listens for requests on port 3490. You can use any other process, including a running instance of a browser, to communicate with the server.

Don't worry about how this works, all you need to use is the send function and C file input (use fread or fgetc, NOT fgets) int send(int s, const void *msg, int len, unsigned int flags);

s - a socket(you will use fd)
msg - data to send
len - number of bytes of data
flags - should be 0.

Finish the program so that it sends the requested file from the current directory through the socket file descriptor.

You can test your program using the html files in the paper environment in the labs - copy index.html and all the .gif files to the directory where the program is being run.

Start a web browser and go to https://127.0.0.1:3490/index.html. You may have to disable proxies for this to work in the labs. If you want, you can add extra error checking to the program to deal with bad requests.

Test the program by requesting a large file. While the file is being sent, use a different browser window to make another request, the second request should have to wait for the first one to finish.

Rewrite the program using threads so that it can reply to multiple requests at the same time. Do not use any global variables.

Submit your source code (the multi-threaded version) electronically from the web page in the labs or at home. Your submission must be a single source file written in ANSI C or C++. Your program should include comments as documentation.

This assignment may be done individually or in pairs. This assignment will be worth 10% of the complete paper. Late submissions will not be marked.

Reference no: EM13313759

Questions Cloud

Depict network topology graphical model initial environment : Depict a network topology graphical model of the initial environment of 10 employees using Visio or its open source alternative software. Note: The graphically depicted solution is not included in the required page length.
Find the lenght of electromagnetive waves : find the lenght of electromagnetive waves if end of frequency omega 10 in 5 hertz omega and absonant is 885 15 perimeter
Determined from the equilibrium data to be percent by mass : a mild steel component in a form of a finite slab with a thickness of 2L=2.5 mm is to be hardened by packing it in a carbonaceous material in a furnace for a predetermined time. the uniform initial carbon concentration of the slab is 0.15 percent ..
Percentage of the bottles filled by the machine : Bottles with less than 12.85 ounces or more than 14.85 ounces are considered to be out of specification. Based on the sample data, what percentage of the bottles filled by the machine will be out of specification?
Write a multi-threaded web server : Rewrite the program using threads so that it can reply to multiple requests at the same time. Do not use any global variables.
Determine the inductive reactance : series RACA socket has some resistance and inductors and capacitors frequency is 50Hz and generator is 100 volts. Determine the inductive reactance
Compute how many ml of 0.200 m naoh : calculate how many mL of 0.200 M NaOH (aq) would be needed to react with the malic acid sample from step c.
How far from the wall should the mirror be located : A concave mirror (R = 56.0 cm) is used to project a transparent slide onto a wall. How far from the wall should the mirror be located
What fraction of the tank air mass will be consumed : The divers work at a depth of 15 m and the seawater density is 1027 kg m-3. They are known to consume 130 litres of air at the ambient temperature is 10oC over the time taken to do the job.

Reviews

Write a Review

Case Study Questions & Answers

  Construct an annotated bibliography

Construct an annotated bibliography - Are corporations obliged to help combat social problems or is factory farming morally justifiable?

  Develop a set of own responsibilities objectives

Develop a set of own responsibilities and performance objectives and evaluate own effectiveness against defined objectives

  Discuss critically infosys current and future strategy

Discuss critically Infosys current and future strategy. What advice would you give Kris Gopalakrishnan and KShop has resulted in information overload among staff. What operational measures would you suggest to overcome such challenges?

  Write health informatics in australia

Please write health informatics in Australia - Is the Biggest Security Threat to Medical Information Simply a Lack of Understanding?

  Discuss the various systems and company strategic vision

Discuss the various systems and the company's strategic vision. You also meet with the heads of Marketing, Travel & Tourism, and Technology to gather their initial thoughts for the site improvements.

  Case study on the next database revolution

Write an essay of no less than five pages with double line spacing describing your observations based on the course contents of the materials that were covered of Erl's textbook. You can also cite one or more other references that you can find?

  Write a draft of the proposal as your boss requested

Draft a set of ground rules for committee meetings. Try to suggest rules that will minimize political differences and focus on the overall benefit to the company.

  Mintendo game girl case study

Which option delivers the maximum profit for the supply chain: Sandra's plan, Bill's plan, or no promotion plan at all? How does the answer change if a discount of $10 must be given to reach the same level of impact that the $5 discount received?

  Business process analysis and technology solution proposal

Business Process Analysis and Technology Solution Proposal;, Using the case provided, propose a 'technology solution' for improving the process identified in Stage 1 and explain how the solution would support the organization's strategic objectives.

  Calculate the payments for a loan on a new complex

In this project, you will create functions that calculate statistical data for apartment complexes. You will then filter the data based on multiple criteria and calculate the payments for a loan on a new complex.

  Produce a fairly comprehensive product

The Technical Journal assignment for the Linux class is not a typical assignment and this document is certainly not a typical "template" to facilitate the assignment.

  Details of the task using tesco plc

Details of the task Using Tesco plc (www.tesco.com) as a case study, prepare a report of no more than 2,500 words that:

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd