Description: 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
To Search:
File list (Check if you may need any files):
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服务器(多线程)