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

  Compare japan competitor and a u.s. competitor product

Firm has contacted you to participate in a focus group. The focus group will compare a Japan competitor product (J) and a U.S. competitor product (U) against China firm's product - compare a Japan competitor product (J) and a U.S. competitor produc..

  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.

  Case study on erp project implementation

Vito was now interested in finding out what the new critical path will be. Furthermore, Vito wanted to start work on the project by July 01, 2013 and wanted to know when the project would be completed.

  What i have wrote in my proposal

I have my proposal ready, but what I need someone gets it done for me. My Prof. is tough about the plagiarism and what I have wrote in my proposal.

  Consider array size 20 populated with random integer values

Write a recursive methodnmbDigitswhich takes an integer value as parameter and returns the number of digits of the parameter value (for examplenmbDigits(2054) is 4).

  Draw a use case diagram for the carpark system

To enable salary deduction of charges, carpark administrators will have the ability to export charges for any billing period. The exported file must be in a format readable by the company's accounting software.

  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.

  Using demorgan law to solve the problem

Using DeMorgan's Law, give an equivalent function for the following: f-(xy2--1-xi,)(y2+w+g)

  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?

  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.

  Carry out a pestel audit of angola

What potential obstacles might SINOPEC encounter as it attempts to integrate and expand its international presence? How can it overcome these obstacles?

  The social economy: finding a way between market and state

Write 900 word summary for given case study. Summary should be less than 20%, more on your personal reflection and opinion.

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