This is an unofficial source code repo for Lewis Napper's WinSock 2.0 (1997) book. The source code is reproduced here for reference (so you don't need to dig up the physical media of the book) and remains the copyright of the book authors.
To build, you'll need Visual Studio 2019 (any version) with the Desktop development with C++ workload installed. Some samples also use MFC, so you'll also need the C++ MFC for latest v142 build tools (x86 & x64) component installed.
I'm currently going through the code, restructuring the directories, and adding Visual Studio 2019 projects to build the projects (converted projects are listed below). As this is decades old Win32 code, I don't plan on fixing compiler or security warnings, but if you do copy any code from this repository, it's strongly advised you heed and understand these warnings.
The conversion effort is ongoing and will take some time. Items listed below are successfully converted samples.
Chapter | Sample | Conversion notes |
---|---|---|
2 | Datagram client and server | OK. |
GetHTTP | OK. | |
HostInfo | OK. | |
WsVer | OK. | |
Stream client and server | OK. | |
4 | Chekmail | OK. Requires MFC. |
5 | Ping | OK. |
PingI | OK. | |
6 | SendMail | OK. Disabled an MFC call to address compiler warning C4996. |
Wsterm | OK. Updated WSTERM.RC2 resource file. |
|
7 | EnumProt |
|
SelProto | OK. | |
8 | Services |
|
9 | GetHttp2 | OK. Changed main() signature. |
GetHttp3 | OK. Changed main() signature. |
|
10 | httpa | OK. There's actually a bug in this sample where requesting for a file in the hosted directory causes a 404 due to an extraneous "/" being prepended to the file name -- I may eventually fix this. |
11 | httpmt | OK. |
12 | ๐ง | In progress. |