WSAStartup is the startup command of WSA (Windows SocKNDs Asynchronous, Windows Asynchronous socket.
To call any Winsock API function in an application, you must use the WSAStartup function to initialize the Winsock service. Therefore, you must call the WSAStartup function. The program using the Socket must call the WSAStartup function before using the Socket. The first parameter of this function indicates the Socket version requested by the program. The high byte indicates the secondary version and the low byte indicates the primary version; the operating system uses the second parameter to return the request's Socket version. When an application calls the WSAStartup function, the operating system searches for the corresponding Socket Library Based on the requested Socket version, and then binds the Socket Library to the application. In the future, the application can call other Socket functions in the requested Socket library.
Int WSAStartup (WORD wVersionRequested, LPWSADATA lpWSAData );
(1) wVersionRequested: a word dual-byte value. In the highest version of Windows Sockets, the caller can use it. The higher-level bytes specify the minor version number (revision), and the lower-level bytes specify the primary version number.
(2) lpWSAData pointer to the WSADATA data structure, used to receive Windows Sockets
[1] implementation details. MAKEWORDMAKEWORD macro platform: SDK creates a 16-bit unsigned integer, and connects two given unsigned parameters. Function prototype: word makeword (BYTE bLow, // specify the low BYTE order of the new variable; BYTE bHigh // specify the high BYTE order of the new variable ;);This article from the "mountain flow" blog, please be sure to keep this source http://xueruixuan.blog.51cto.com/4912733/1276664