The meaning of two member variables when Windows WSABUF structure is applied in IOCP

Source: Internet
Author: User

The prototype of the WSABUF structure is as follows:

1 struct __wsabuf 2 {3    u_long len; 4     Char FAR *buf; 5 } wsabuf, *lpwsabuf;

The structure is used in IOCP for the second parameter of the function WSARecv () and the WSASend () function, and the third parameter specifies the number of array elements when the parameter is set to an arrays.

The meaning of the structure in two functions is also slightly different, mainly in Wsabuf::len this parameter. When it does the argument of the WSARecv () function, Len is understood as the length of the buffer wsabuf::buf. When you do the WSASend () function parameter, it is interpreted as the total length of the send, starting with Wsabuf::buf.

The meaning of two member variables when Windows WSABUF structure is applied in IOCP

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.