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

  From the scenario, prioritize the attributes of golds reling

From the scenario, prioritize the attributes of Golds Reling's brand from the brand map presented in the scenario according to the attributes that you believe would be most important to the new tablet's target market. Provide support for your respons..

  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?

  Review tarmac business case for diversity

Review Tarmac's Business Case for Diversity and the Learning Resources. Think about Tarmac's approach to managing diversity and how it relates to organisational behaviour concepts and human resource processes.

  Enron case shared activity

Enron was the first nationwide natural gas pipeline network in the United States. As the company grew, executives shifted the company's primary focus from energy delivery and infrastructure to investing in the stock market.

  Ebay inc internet success or fairy tale

Read the case study "eBay Inc.: Internet Success or Fairy Tale? "and answer the question below,   Use the 2002 financial statement data to replicate the Meyer's report calculations that illustrate the conclusion based on the 2001 data reached in the ..

  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?

  Splash soft drinks case study

Splash Soft Drinks Inc. (SSD) has recently achieved sales that exceeded its expectations after it introduced a new beverage that was greatly welcomed by their customers. The company is currently considering opening a new plant to which some of the pr..

  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:

  What are the common manifestations of alcoholic cirrhosis

What are the common manifestations of alcoholic cirrhosis? Which of these are secondary to hepatocellular failure? Which are secondary to portal hypertension?

  Judge the extent to which the marketing plan at just us

From the case study, judge the extent to which the marketing plan at Just Us! is outdated. Propose two (2) ways that Just Us! could improve the customer experience and thus sustain future growth.

  Read natasha kingery case and answer the questions

Read the DATA CASE on pages 126-127 about Natasha Kingery who is considering furthering her education and is seeking financial advice. Determine the interest rate she is currently earning on her inheritance by going to Yahoo!

  Identify the relevant facts of the case study

Imagine you are the financial controller of XYZ Ltd a corporation that is a very large donor to HOHO. You have recently become aware that its TV advertising has resulted in the charity violating the 25% expenditure ratio for its charity drive.    Id..

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