Syntax

Members

AddrCount

The number of address structures in the AddrList array.

AddrList

An array of
SOCKADDR_STORAGE structures that contains IP addresses in either IPv4 or IPv6 form. To determine what form an address in the list has, cast it to a SOCKADDR and examine the sa_family element. If sa_family is equal to AF_INET, the address is in IPv4 form, or if it is equal to AF_INET6, the address is in IPv6 form.

Remarks

An IPv4 address may be expressed as a literal string of four dotted decimal numbers, each in the range 0-255, such as 192.168.197.113. IPv4 addresses are contained in sockaddr_in structures, declared in the Windows header file Winsock2.h as follows:

The SOCKADDR_IN structure is exactly equivalent to sockaddr_in by typedef.

An IPv6 address can be expressed as a literal string enclosed in square brackets that contains hex numbers separated by colons; examples are: [::1] and [3ffe:ffff:6ECB:0101]. IPv6 addresses are contained in sockaddr_in6 structures, declared in the Windows header file WS2tcpip.h as follows: