SOCKET_ADDRESS structure (ws2def.h)

The SOCKET_ADDRESS structure stores protocol-specific address information.

Syntax

typedef struct _SOCKET_ADDRESS {
  LPSOCKADDR lpSockaddr;
  INT        iSockaddrLength;
} SOCKET_ADDRESS, *PSOCKET_ADDRESS, *LPSOCKET_ADDRESS;

Members

lpSockaddr

A pointer to a socket address represented as a SOCKADDR structure.

iSockaddrLength

The length, in bytes, of the socket address.

Remarks

The SOCKADDR structure pointed to by the lpSockaddr member varies depending on the protocol or address family selected. For example, the sockaddr_in6 structure is used for an IPv6 socket address while the sockaddr_in4 structure is used for an IPv4 socket address. The address family is the first member of all of the SOCKADDR structures. The address family is used to determine which structure is used.

On the Microsoft Windows Software Development Kit (SDK) released for Windows Vista and later, the organization of header files has changed and the SOCKET_ADDRESS structure is defined in the Ws2def.h header file. Note that the Ws2def.h header file is automatically included in Winsock2.h, and should never be used directly.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Header ws2def.h (include Winsock2.h)

See also

SOCKADDR

SOCKET_ADDRESS_LIST

Using SIO_ADDRESS_LIST_SORT

WSAIoctl

LPWSPIoctl