Export (0) Print
Expand All
6 out of 7 rated this helpful - Rate this topic

WSABUF structure

The WSABUF structure enables the creation or manipulation of a data buffer used by some Winsock functions.

Syntax


typedef struct __WSABUF {
  u_long   len;
  char FAR *buf;
} WSABUF, *LPWSABUF;

Members

len

The length of the buffer, in bytes.

buf

A pointer to the buffer.

Example Code

The following example demonstrates the use of the WSABUF structure.


WSABUF DataBuf;
char SendBuf[1024] = "Test data to send.";
int BufLen = 1024;

//...

DataBuf.len = BufLen;
DataBuf.buf = SendBuf;

//...

WSASendTo(SendSocket, 
  &DataBuf, 
  1,
  &BytesSent,
  Flags,
  (SOCKADDR*) &RecvAddr,
  RecvAddrSize,
  &Overlapped,
  NULL);


Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Winsock2.h

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.