Ask Case Study Expert

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 http://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.

Case Study, Writing

  • Category:- Case Study
  • Reference No.:- M9893071
  • Price:- $50

Priced at Now at $50, Verified Solution

Have any Question?


Related Questions in Case Study

Aim of assessmentone important way that infants and young

Aim of assessment: One important way that infants and young children learn about their world is through their psychosocial devel- opment. This assessment item aims to provide you with an opportunity to explore the psycho ...

Assignment - solve the given case using below stepscase -

Assignment - Solve the given case using below steps. Case - The South African Wine Industry in 2016: Where Does It Go from Here? Steps - 1. Identify the Article/Topic/Situation. 2. Gather Info (Company website). 3. Sort. ...

Assignment - media evolution analysisassignment details

Assignment - Media Evolution Analysis Assignment details: Following our lectures and discussions in class, choose one media technology or phenomenon and research its historical trajectory. In particular, you should focus ...

Company law assignment question -hi tech supplies pty ltd

COMPANY LAW: ASSIGNMENT QUESTION - Hi Tech Supplies Pty Ltd is a company formed by two friends, Bill and Sue who met while studying computer studies at University. The company has very little assets and Bill and Sue have ...

Growth development and ageing for exercise scientists

Growth, Development and Ageing for Exercise Scientists Assessment Task - Video Critique Instructions This assessment task will assess your ability to apply key concepts of growth, development and ageing to a series of ca ...

Importance of communicable disease surveillanceword

Importance of communicable disease surveillance. word count:300

Case - adidasquestions1 analyse the importance of using

Case - ADIDAS QUESTIONS 1. Analyse the importance of using both above-the-line and below-the-line communication for Adidas. 2. Justify how effective you feel the high cost use of sponsorship has been to Adidas? 3. Evalua ...

Question 1requiredwhat is the major environmental or

QUESTION 1 Required: WHAT is the major environmental or resource issue, HOW is it caused and WHERE is it occurring? WHAT is the main resource involved and HOW is it being impacted or developed? WHO are the primary stakeh ...

Answer the questions using volkswagen group- write on this

Answer the questions using Volkswagen Group- write on this topic Case Assignment Please select a company from among the ones listed below (see Articles for Case Assignment) or else select an organization of choice facing ...

Fever case study -elena is a 74-year-old hispanic f who was

Fever Case Study - Elena is a 74-year-old Hispanic F who was recently discharged one week ago from a local rehabilitation center after status post left hip replacement (one month ago). Negative for any complications. PMH ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As