Freigeben über


WSABUF Structure

The WSABUF structure enables the creation or manipulation of a data buffer.

Syntax

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

Mitglieder

  • len
    Length of the buffer, in bytes.

  • buf
    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);

Anforderungen

Mindestens unterstützter Client

Windows 2000 Professional

Mindestens unterstützter Server

Windows 2000 Server

Header

Winsock2.h