Learning note (1)

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.