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

  Write a report which contains a listing of your program

A tubular post of square cross section, designed to support a uniformly distributed load on a horizontal platform, is shown in Figure A. The principal stresses and maximum shear stresses at points A and B at the base of the post have to be determi..

  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:

  Evaluate apples resources and competitive position

Critically analyse how leadership impacts on the organisational culture of Apple and evaluate Apple's resources and competitive position.

  Determine whether the prosecutor has proved his case

What do vou look for to determine whether the prosecutor has proved his case? And what to determine whether the defense has proved her nice?

  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.

  Case study on burger king: promoting a food fight

What are Burger King's communication objectives for its target audience and with its focus on the "super fan," does BK risk alienating / isolating other customers? What are the implications of this?

  What is the nature of media state relations

What is the nature of media state relations in the middle east for example israel

  Estimate of the impact of the program

State A implented a program to reduce smoking rates in 2005. State B did not. Using the data provided in the attached graph, calculate the difference-in-difference estimate of the impact of the program.

  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?

  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.

  Write health informatics in australia

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

  Brief description of the project objectives

Development of new software to address green computing for internal use and potential sale to other organizations.

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