I am trying to migrate the ipv4 server / client to ipv6, but the compiler says it is SOCKADDR_IN6not declared in the scope. SOCKADDR_INdeclared, but not SOCKADDR_IN6. <Winsock2.h>.
SOCKADDR_IN6
SOCKADDR_IN
<Winsock2.h>
Does anyone have any idea why it was not announced?
The Microsoft documentation forsockaddr_in6 says that it is defined in the header ws2tcpip.h, perhaps you need to include this.
sockaddr_in6
ws2tcpip.h
On Linux, you will need different options, sys/socket.hand netinet/in.h.
sys/socket.h
netinet/in.h
SOCKADDR_IN6 ws2ipdef.h (Visual Studio 2008). , , MS Docs , ( Ws2tcpip.h).
ws2ipdef.h
Ws2tcpip.h
msdn:
struct in_addr6 { u_char s6_addr[16]; /* IPv6 address */ }; struct sockaddr_in6 { short sin6_family; /* AF_INET6 */ u_short sin6_port; /* Transport level port number */ u_long sin6_flowinfo; /* IPv6 flow information */ struct in_addr6 sin6_addr; /* IPv6 address */ u_long sin6_scope_id; /* set of interfaces for a scope */ };
:
SOCKADDR_IN6 != sockaddr_in6
?winsock, , IPV6, , .
Source: https://habr.com/ru/post/1758800/More articles:Strategy to keep string constants in sync between java / flex? - javaCannot link directly to WMV video file - sharepointhow secure is digital signature? - securityCan TFS projects link to each other? - .netEquivalent of Crosstab Access request in SAS? - sasmatplotlib full screen mats - pythonAre Java ACM libraries in real life? - javavector T> :: is iterator invalid? - c ++Почему авторы стандарта C/C99 не указывают... стандартное значение для типов типов с плавающей точкой? - cDynamic Programming Idiom for Combinations - language-agnosticAll Articles