Networking on Windows PlatformsProgramDevelopment, you can use different libraries, but the most common is the database developed by Microsoft. Specifically, there are:
(1) WinSock, a development library working at the network layer and transport layer, is suitable for compiling TCP, UDP, and original IP communication programs. The original function is basically in line with the UNIX socket standard. Most programs on Windows platforms, such as QQ and Xunlei, are developed based on them.
(2) ws2_32 is an upgraded version of WinSock. Based on its compatibility, ws2_32 is not compliant with the UNIX socket standard, but is more suitable for library functions on Windows platforms, generally starting with WSA.
Most modern Windows platform programs are also dependent on this library.
(3) wininet, Windows Internet extension library, working on the application protocol layer, provides the implementation of HTTP, FTP, and Gopher protocols, and provides a basic platform for program development based on the above three protocols, it should be noted that, although wininet works at the application layer, its own wininet. DLL implementation does not depend on Winsock. DLL or ws2_32.dll, but exists independently. At least the current version is like this. The most famous example of wininet-based applications is IE.
(4) WinHTTP, which also works on the application protocol layer, provides HTTP implementation. It seems that there are duplicates with wininet. Yes, WinHTTP is designed to replace the HTTP part in wininet. It is more robust and stable, and provides database functions for HTTP server development. For modern HTTP development, we recommend that you use WinHTTP instead of wininet. A famous example of development using WinHTTP is Google's Chrome browser. However, Google gave up WinHTTP in chrome and later versions, but used its own developed HTTP library, this is also an important measure to enable chrome to implement cross-platform. In addition, WinHTTP. dll does not depend on Winsock or ws2_32 and runs independently.
If Programming Based on socket, The winows platform and other platform functions are basically the same, it is easier to implement cross-platform.
If you program based on HTTP, the libraries on different platforms are very different. If you do not consider cross-platform WinHTTP, you can consider using libwww for cross-platform programming.
In addition, wsock, wininet, or WinHTTP can also be used at the same time.