windowsporting

In which way can i make use of AF_UNIX defined in Winsock2 in Windows


I have tried AF_UNIX with Windows socket API as follows:

socket(AF_UNIX, SOCK_STREAM, 0);

Above call returned INVALID_SOCKET. Last error was:

10047 "An address incompatible with the requested protocol was used".

The results were same when i tried the same with other socket 'type' values available in Windows like SOCK_DGRAM and SOCK_RAW.

So my question is: Is there any way to make use of AF_UNIX defined in 'Winsock2', so that its functionality similar to that in UNIX can be achieved here in Windows?


Solution

  • The documentation on MSDN for the socket function says:

    The values currently supported are AF_INET or AF_INET6, which are the Internet address family formats for IPv4 and IPv6. Other options for address family (AF_NETBIOS for use with NetBIOS, for example) are supported if a Windows Sockets service provider for the address family is installed.

    So, unless you have installed a third-party service provider, you cannot use AF_UNIX.