文件名称:web
- 所属分类:
- Internet/网络编程
- 资源属性:
- [Windows] [Visual C] [源码]
- 上传时间:
- 2015-06-05
- 文件大小:
- 1.15mb
- 下载次数:
- 0次
- 提 供 者:
- 刘*
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
实验4 Web服务器(多线程,可以多个浏览器访问多个不同文件)
要求:(1)TCP
(2)C/S
(3)http
摘要:设计一个简单的web服务器,它仅能处理一个请求。
具体:
Web服务器:
当一个客户(浏览器,输入URL:http://127.0.0.1/index.html)连接时创建一个连接套接字;
从连接套接字接收http请求报文。
解释该请求以确定所请求的文件(解析文件名);
从服务器的文件系统获得请求的文件。
创建一个由请求的文件组成的http响应报文。(报文包含状态行+实体体)。
经TCP连接想请求的浏览器发送响应。如果浏览器请求的文件不在服务器,服务器返回“404 Not Found”差错报文。
注意:1)如果80端口已经被其他进程占用,服务器端口改为5050。则浏览器输入的URL:http://127.0.0.1:5050/index.html-Experiment 4 Web server
Requirements: (1) TCP
(2) C/S
(3) http
Abstract: The design of a simple web server, it can handle only one request.
Specifically:
Web server:
Create a connection socket connection When a client (//127.0.0.1/index.html browser, enter the URL:: http)
Http request message is received the connection socket.
Interpret the request to determine the requested file (file name parsing)
Access to documents requested the server s file system.
Create a document requested by the composition of http response packets. (Packet contains a status line+ solid body).
After TCP connection would like to request the browser sends a response. If the file is not in the server browser requests, the server returns 404 Not Found error message.
Note: 1) If port 80 is already in use by another process server port to 5050. Enter the URL of your browser: http: //127.0.0.1: 5050/index.html
要求:(1)TCP
(2)C/S
(3)http
摘要:设计一个简单的web服务器,它仅能处理一个请求。
具体:
Web服务器:
当一个客户(浏览器,输入URL:http://127.0.0.1/index.html)连接时创建一个连接套接字;
从连接套接字接收http请求报文。
解释该请求以确定所请求的文件(解析文件名);
从服务器的文件系统获得请求的文件。
创建一个由请求的文件组成的http响应报文。(报文包含状态行+实体体)。
经TCP连接想请求的浏览器发送响应。如果浏览器请求的文件不在服务器,服务器返回“404 Not Found”差错报文。
注意:1)如果80端口已经被其他进程占用,服务器端口改为5050。则浏览器输入的URL:http://127.0.0.1:5050/index.html-Experiment 4 Web server
Requirements: (1) TCP
(2) C/S
(3) http
Abstract: The design of a simple web server, it can handle only one request.
Specifically:
Web server:
Create a connection socket connection When a client (//127.0.0.1/index.html browser, enter the URL:: http)
Http request message is received the connection socket.
Interpret the request to determine the requested file (file name parsing)
Access to documents requested the server s file system.
Create a document requested by the composition of http response packets. (Packet contains a status line+ solid body).
After TCP connection would like to request the browser sends a response. If the file is not in the server browser requests, the server returns 404 Not Found error message.
Note: 1) If port 80 is already in use by another process server port to 5050. Enter the URL of your browser: http: //127.0.0.1: 5050/index.html
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Web服务器(多线程)\._Server.cpp
...................\1.txt
...................\index.html
...................\ReadMe.txt
...................\Server.cpp
...................\Server.dsp
...................\Server.dsw
...................\Server.ncb
...................\Server.opt
...................\Server.plg
...................\StdAfx.cpp
...................\StdAfx.h
...................\Debug\Server.exe
...................\.....\Server.ilk
...................\.....\Server.obj
...................\.....\Server.pch
...................\.....\Server.pdb
...................\.....\vc60.idb
...................\.....\vc60.pdb
...................\Debug
Web服务器(多线程)