Description: The program used to implement to achieve the GET request method of Web server program, by creating ServerSocket class object, monitor port 8080 waiting to receive client connections to port 8080 create a word associated with the socket input stream and output stream then , read the client request information, if the request type is GET, request information from the visit to get the HTML file name, if the HTML file exists, then open the HTML file, the HTTP header information and the HTML file content returned by socket to the Web browser, then close the file. Otherwise, an error message sent to Web browser. Finally, close the Web browser with the corresponding socket connection word.
To Search:
File list (Check if you may need any files):
新建 Microsoft Word 文档.doc