Junior to end, want to write something, one is to accumulate some technology, second, for the next semester internship to do preparation, or resume on the project experience really nothing to write.
The bottom-level of C + + is the operating system and various protocols and memory layouts, and Java is the JVM. If you don't want to write a generic application, then implement a cross-platform, static Web server from 0.
Encapsulates the various classes across platforms: Socket classes with TCP and UDP, HTTP packet parsing and generation classes, and a class that reads HTML files
The result of the operation is quite good, under the Windows platform
Server Startup
Handling Browser Requests
Browser display
When we request a Web page that does not exist
Running results under the Linux platform
Browser display
Because the test is only available, so the HTML file is relatively simple, you can also put other HTML files in the project root folder.
Interested can go to the next source code
Source Code Link: http://download.csdn.net/detail/kyt511/8864901
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Implementation of a cross-platform static Web server from zero