newbie : cannot create IPv6 sockets

Hi:

I would like to use IPv6 sockets in a C code. Everything works fine on Linux but on Windows, I can't create them: I get a WSAEAFNOSUPPORT error.

#ifndef WIN32
# include <netinet/in.h>
# include <sys/socket.h>
#else
#define WIN32_LEAN_AND_MEAN
# include <Winsock2.h>
# include <ws2tcpip.h>
#endif

int main()
{
#ifdef WIN32
SOCKET s;
WSADATA wsadata;
if (WSAStartup(MAKEWORD(2, 2), &wsadata) != 0) {
fprintf(stderr, "WSAStartup failed.\n");
exit(1);
}
#else
int s;
#endif
s = socket(AF_INET6,SOCK_DGRAM,0);
}
Any ideas? Thanks

Kat
PS: I use Visual .Net 2003
[766 byte] By [Kathlyn] at [2007-11-19 14:01:43]
# 1 Re: newbie : cannot create IPv6 sockets
You need to "turn on" IPv6 networking in your test computer. It's not enabled by default, and you need to install it. See "IPv6 Protocol for the Windows Family of Operating Systems: Frequently Asked Questions" at http://www.microsoft.com/windowsserver2003/techinfo/overview/ipv6faq.mspx under the question "How do I install the IPv6 Protocol for Windows XP?" (or "Server 2003" if that's what you have).

See this thread, which asks basically the same question: "PF_INET6 protocol" at http://www.dev-archive.com/forum/showthread.php?t=357463

Mike
MikeAThon at 2007-11-9 13:50:44 >
# 2 Re: newbie : cannot create IPv6 sockets
Thanks for answering !

Kathlyn
Kathlyn at 2007-11-9 13:51:45 >