提供高质量的essay代写,Paper代写,留学作业代写-天才代写

首頁 > > 詳細

代寫program編程、代做Java,Python程序語言、c++程序代寫代寫留學生 Statistics統計、回歸、迭代|幫做C/C++編程

WebServer
Our final project is a group assignment. You will need to find a partner. No one can work alone and there can only be one group of 3 (ok’ed by me). Not finding a partner will mean getting a 0 on the assignment.

A web server is a program that connects to a port (networking), listens for requests and sends the appropriate file to the requestor. Web servers must respond to requests and create a response using the “HTTP protocol (https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol). For our web server, we will use only the most critical portions of the protocol:
A request (which you will receive) will consist of the word “GET”, a space, a path to the file, a space and then the version of HTTP which is implemented (you can ignore this) all on the first line. There will be other lines to the request – you can ignore them.
A response (which you will generate) will consist of: the string “HTTP/1.0 “, followed by code (200 for OK or 404 for file not found), a new line, then “Content-Length: “ + the number of bytes of the response followed by 2 new lines.
An example session follows. Red is the request, blue is the response:
GET /test2.html HTTP/1.1
Host: localhost:8000
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
DNT: 1
Connection: keep-alive
Upgrade-Insecure-Requests: 1
HTTP/1.0 200 OK
Content-Length:6

test2

Your program should run on port 8000 (port 80, which is the usual for web applications, will be blocked by your firewall). Your program should take a path as a parameter (and fail with a usage message if there is no parameter). That path will be the path that your web server will use to serve files. For example – let’s say that the path is /home/mphipps. If I try to access localhost:8000/secret/data.html, your web server will look at: /home/mphipps/secret and try to serve data.html. If the file is there, it should return it with a “200 OK” message, as above. If the file does not exist, you should return a “404 Not Found” message with a pre-designed response (could be a file or could be a hard coded message).
Your web server should launch a new thread for each request. You should use POSIX commands for files (no fopen/fclose/etc) and pthreads for threadedin. Your web server should be an infinite loop of waiting for and processing requests.
Hints:
Don’t wait – start this soon.
My code was around 150 lines. Yours should not be much longer or shorter.

Rubric Poor OK Good Great
Comments None/Excessive (0) “What” not “Why”, few (5) Some “what” comments or missing some (7) Anything not obvious has reasoning (10)
Variable/Function naming Single letters everywhere (0) Lots of abbreviations (5) Full words most of the time (8) Full words, descriptive (10)
Structure Globals everywhere, indentation doesn’t match braces {}, no helper functions (0) Any 2 of:
Too many globals
Indentation wrong
Missing helper functions (5) Any 1 of:
Too many globals
Indentation wrong
Missing helper functions (13) Few/no globals, indentation correct, helper functions(20)
Threading No threading (0) One thread per request (10)
Networking No networking (0) Some attempt at setup/listening (10) Setup, Listening and teardown work correctly (20)
File Handling None/uses “f” style functions (0) Uses open/close/read (10) Uses open/close/read/stat (20)
HTTP No attempt at HTTP (0) Reads requests (3) Reads requests, handles 200 responses (7) Requests, 200, 404 (10)

聯系我們
  • QQ:1067665373
  • 郵箱:1067665373@qq.com
  • 工作時間:8:00-23:00
  • 微信:Essay_Cheery
熱點文章
程序代寫更多圖片

聯系我們 - QQ: 1067665373 微信:Essay_Cheery
? 2021 uk-essays.net
程序代寫網!

在線客服

售前咨詢
售后咨詢
微信號
Essay_Cheery
微信
全优代写 - 北美Essay代写,Report代写,留学生论文代写作业代写 北美顶级代写|加拿大美国论文作业代写服务-最靠谱价格低-CoursePass 论文代写等留学生作业代做服务,北美网课代修领导者AssignmentBack 北美最专业的线上写作专家:网课代修,网课代做,CS代写,程序代写 代码代写,CS编程代写,java代写北美最好的一站式学术代写服务机构 美国essay代写,作业代写,✔美国网课代上-最靠谱最低价 美国代写服务,作业代写,CS编程代写,java代写,python代写,c++/c代写 代写essay,作业代写,金融代写,business代写-留学生代写平台 北美代写,美国作业代写,网课代修,Assignment代写-100%原创 北美作业代写,【essay代写】,作业【assignment代写】,网课代上代考