& Assignment InformationThis program shall be written in C, compiled with the following options: -Wall -Wextra-std=c99, and display no errors and no warnings. Do not submit executable files (only C source files).In this assignment, you are to implement a simple Web server using the attached framework. The framework consists of 4 files:simple-server.c - The main function of the server and the functions to start and stop the server and to wait for client requests. You must read this file and understand it. Do not make any changes to this file.simple-server.h - Function prototypes. Do not make any changes to this file.my-server.c - A sample implementation of the server. You must read this file and understand it. You must also re-implementit, as described below.makefile - The makele for the project. You are advised to use it to build the project.After downloading and unpacking the framework, run make. If the project builds successfully, you will get an executable file testserver. Run the program, then open a web browser and connect to http://localhost:8080 (replace 8080 with another port number if you pass it as the command line argument to testserver). You shall see a valid Web page.Your Web server shall:Start a new detached thread for each incoming request (the functiondo_server_stuff() shall, therefore, immediately return).Read an HTTP request sent by the client from the client socket.If the request is not in the form GET /some_file_name.html HTTP/…, respond with 405 Method Not Allowed. (See sample response in my-server.c).If the request is in the form GET /some_file_name.html HTTP/…, and some_file_name exists in the directory /tmp of your computer, respond with 200 OK, followed by the content of the file /tmp/some_file_name. (You may want to provide support for some image files, too, for extra credit, but make sure to change the Content-Type header accordingly!)If the request is in the form GET /some_file_name HTTP/…, and some_file_name does not exist in the directory /tmp of your computer or is not an HTML file (unless you opt to support image files), respond with 404 Not Found.If the request is in the form GET /STOP HTTP/…, terminate the server by setting the global variable done to 1.Maintain the total count of serviced requests and the count of currently running threads in the global variables total and current (not provided). Since the variables are shared among all threads, any thread attempting to change any of the variables shall first obtain a mutex.If the request is in the form GET/ STATS HTTP/…, respond with 200 OK, followed by the values of the variables total and current in the form of a human-readable HTML document.Test the functionality of your server by loading any HTML documents with a plenty of images and local links into your /tmp and browsing them. make sure to test the requests STATS and STOP, too, by pointing your browser at http://localhost:8080/STATS and http://localhost:8080/STOP, respectively. server.zip本团队核心人员组成主要包括BAT一线工程师,精通德英语!我们主要业务范围是代做编程大作业、课程设计等等。我们的方向领域:window编程 数值算法 AI人工智能 金融统计 计量分析 大数据 网络编程 WEB编程 通讯编程 游戏编程多媒体linux 外挂编程 程序API图像处理 嵌入式/单片机 数据库编程 控制台 进程与线程 网络安全 汇编语言 硬件编程 软件设计 工程标准规等。其中代写编程、代写程序、代写留学生程序作业语言或工具包括但不限于以下范围:C/C++/C#代写Java代写IT代写Python代写辅导编程作业Matlab代写Haskell代写Processing代写Linux环境搭建Rust代写Data Structure Assginment 数据结构代写MIPS代写Machine Learning 作业 代写Oracle/SQL/PostgreSQL/Pig 数据库代写/代做/辅导Web开发、网站开发、网站作业ASP.NET网站开发Finance Insurace Statistics统计、回归、迭代Prolog代写Computer Computational method代做因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:99515681@qq.com 微信:codehelp QQ:99515681 或邮箱:99515681@qq.com 微信:codehelp
网友评论