UNIX域套接字上的net.Listen在Windows Server 2008上失败

问题描述

我正在使用域套接字(gRPC)在进程之间交换数据,其代码如下:

rpcListener,err = net.Listen("unix","path\\to\\my\\uds.sock")
if err != nil {
    l.Errorf("start gRPC server Failed: %s",err)
    return
}

将引发以下错误

start gRPC server Failed: listen unix path\to\my\uds.sock: socket: An address incompatible with the requested protocol was used.

在Windows 10上,这可以正常工作,Windows-server-2008 / windows-7是否不支持套接字?

解决方法

来自AF_UNIX comes to Windows

从Insider Build 17063开始,您将能够使用Windows上的unix套接字(AF_UNIX)地址族在Win32进程之间进行通信。

因此,在Windows 7和Windows Server 2008等旧版Windows中,甚至在Windows 10的旧版本中,似乎都不支持它。