Export (0) Print
Expand All
Expand Minimize

GetAcceptExSockaddrs function

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.

Note  This function is a Microsoft-specific extension to the Windows Sockets specification.

Syntax


void GetAcceptExSockaddrs(
  _In_   PVOID lpOutputBuffer,
  _In_   DWORD dwReceiveDataLength,
  _In_   DWORD dwLocalAddressLength,
  _In_   DWORD dwRemoteAddressLength,
  _Out_  LPSOCKADDR *LocalSockaddr,
  _Out_  LPINT LocalSockaddrLength,
  _Out_  LPSOCKADDR *RemoteSockaddr,
  _Out_  LPINT RemoteSockaddrLength
);

Parameters

lpOutputBuffer [in]

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.

dwReceiveDataLength [in]

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.

dwLocalAddressLength [in]

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.

dwRemoteAddressLength [in]

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.

LocalSockaddr [out]

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.

LocalSockaddrLength [out]

The size, in bytes, of the local address. This parameter must be specified.

RemoteSockaddr [out]

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.

RemoteSockaddrLength [out]

The size, in bytes, of the local address. This parameter must be specified.

Return value

This function does not return a value.

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.

Note  The function pointer for the GetAcceptExSockaddrs function must be obtained at run time by making a call to the WSAIoctl function with the SIO_GET_EXTENSION_FUNCTION_POINTER opcode specified. The input buffer passed to the WSAIoctl function must contain WSAID_GETACCEPTEXSOCKADDRS, a globally unique identifier (GUID) whose value identifies the GetAcceptExSockaddrs extension function. On success, the output returned by the WSAIoctl function contains a pointer to the GetAcceptExSockaddrs function. The WSAID_GETACCEPTEXSOCKADDRS GUID is defined in the Mswsock.h header file.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Mswsock.h

Library

Mswsock.lib

DLL

Mswsock.dll

See also

Winsock Reference
Winsock Functions
AcceptEx
getpeername
getsockname
sockaddr

 

 

Community Additions

ADD
Show:
© 2014 Microsoft