GetAcceptExSockaddrs function (winsock.h)
The GetAcceptExSockaddrs function parses the data obtained from a call to the AcceptEx function and passes the local and remote addresses to a sockaddr structure.
Syntax
void GetAcceptExSockaddrs(
[in] PVOID lpOutputBuffer,
[in] DWORD dwReceiveDataLength,
[in] DWORD dwLocalAddressLength,
[in] DWORD dwRemoteAddressLength,
[out] sockaddr **LocalSockaddr,
[out] LPINT LocalSockaddrLength,
[out] sockaddr **RemoteSockaddr,
[out] LPINT RemoteSockaddrLength
);
Parameters
[in] lpOutputBuffer
A pointer to a buffer that receives the first block of data sent on a connection resulting from an AcceptEx call. Must be the same lpOutputBuffer parameter that was passed to the AcceptEx function.
[in] dwReceiveDataLength
The number of bytes in the buffer used for receiving the first data. This value must be equal to the dwReceiveDataLength parameter that was passed to the AcceptEx function.
[in] dwLocalAddressLength
The number of bytes reserved for the local address information. This value must be equal to the dwLocalAddressLength parameter that was passed to the AcceptEx function.
[in] dwRemoteAddressLength
The number of bytes reserved for the remote address information. This value must be equal to the dwRemoteAddressLength parameter that was passed to the AcceptEx function.
[out] LocalSockaddr
A pointer to the sockaddr structure that receives the local address of the connection (the same information that would be returned by the getsockname function). This parameter must be specified.
[out] LocalSockaddrLength
The size, in bytes, of the local address. This parameter must be specified.
[out] RemoteSockaddr
A pointer to the sockaddr structure that receives the remote address of the connection (the same information that would be returned by the getpeername function). This parameter must be specified.
[out] RemoteSockaddrLength
The size, in bytes, of the local address. This parameter must be specified.
Return value
None
Remarks
The GetAcceptExSockaddrs function is used exclusively with the AcceptEx function to parse the first data that the socket receives into local and remote addresses. The AcceptEx function returns local and remote address information in an internal format. Application developers need to use the GetAcceptExSockaddrs function if there is a need for the sockaddr structures containing the local or remote addresses.
Windows Phone 8: This function is supported for Windows Phone Store apps on Windows Phone 8 and later.
Windows 8.1 and Windows Server 2012 R2: This function is supported for Windows Store apps on Windows 8.1, Windows Server 2012 R2, and later.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 8.1, Windows Vista [desktop apps | UWP apps] |
Minimum supported server | Windows Server 2003 [desktop apps | UWP apps] |
Target Platform | Windows |
Header | winsock.h (include Mswsock.h) |
Library | Mswsock.lib |
DLL | Mswsock.dll |