Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

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

Read the altagas forrest kerr hydroelectric project case

Read the "AltaGas: Forrest Kerr Hydroelectric Project" case; then prepare and answer the following questions in a 4 to 5 pages document. In your answers use and refer to the various concepts presented in the module. Be c ...

Task 1 just the factsinstructions- read the statement below

Task 1: Just the Facts Instructions - Read the statement below carefully. - Conduct some research and write down your answers in the space provided. An Australian Culture Overview Australia is a vast island continent sit ...

Assessmenttwo large travel agencies are about to merge

Assessment Two large Travel Agencies are about to merge together. Holiday Seekers Travel Agency and Small WorldTravel Agency are both public companies (shares listed on the stock exchange). TheHoliday Seekers Travel Agen ...

Article review you are required to explain the

Article review, you are required to explain the circumstances surrounding this article. Also, be sure to address these questions in your response. Do you agree or disagree with accepting private funds for the agency and ...

Theory identification and analysisassignment overviewthree

Theory Identification and Analysis Assignment Overview Three of the four assignments in this course deal with the place of theory in social work practice. A solid understanding of the theoretical basis for understanding ...

This paper will consist of an ethical analysis of the bp

This paper will consist of an ethical analysis of the BP oil spill. There is one source provided to start this research, cite at least four other sources. This source has a particular case because it has an interesting a ...

Assignment -read the hefty hardware case study and answer

Assignment - Read the Hefty Hardware Case Study and answer the questions. Discussion Questions 1) Overall, how effective is the partnership between IT and the business at Hefty Hardware? Identify the shortcomings of both ...

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 ...

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. ...

Safety management planwrite and submit for assessment a

Safety Management Plan Write and submit for assessment a Safety Management Plan for an organisation of your choice. There are many models that you can use to base your Safety Management Plan on. Some models include the m ...

  • 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