WSASendTo

WSASendto transmits a message on a socket. This function may be used on connected or unconnected sockets.

Syntax

int WSASendTo(
    __in SOCKET s,
    __in LPWSABUF lpBuffers,
    __in DWORD dwBufferCount,
    __out LPDWORD lpNumberOfBytesSent,
    __in DWORD dwFlags,
    __in const struct sockaddr *lpTo,
    __in int iToLen,
    __in LPWSAOVERLAPPED lpOverlapped,
    __in LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
);

Parameters

s

Socket descriptor for a connected socket.

lpBuffers

A pointer to a WSABUF structure. The WSABUF structure contains a pointer to a buffer and the length, in bytes, of the buffer.

dwBufferCount

Ignored. The number of WSABUF structures in the lpBuffers array.

lpNumberOfBytesSent

A pointer to the number of bytes sent by this call if the WSASendTo operation completes..

dwFlags

WSASendTo flags. Refer to WSASend for possible values

lpTo

An optional pointer to the address of the target socket in the SOCKADDR structure.

iToLen

The size, in bytes, of the address in the lpTo parameter.

lpOverlapped

Ignored. A pointer to a WSAOVERLAPPED structure (ignored for nonoverlapped sockets).

lpCompletionRoutine

Ignored. A pointer to the completion routine called when the send operation has been completed (ignored for nonoverlapped sockets).

Return Values

A positive value if the function succeeds, SOCKET_EROR if the function fails

Use WSAGetLastError to retrieve a specific error code.

Requirements

Library Rtxtcpip.lib
IntervalZero.com | Support | Give Feedback