windows - 我可以通过什么方式在Windows中使用Winsock2中定义的AF_UNIX

标签 windows porting

我已经尝试使用 Windows 套接字 API 进行 AF_UNIX,如下所示:

socket(AF_UNIX, SOCK_STREAM, 0);

以上调用返回了INVALID_SOCKET。最后的错误是:

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

当我尝试使用 Windows 中可用的其他套接字“类型”值(例如 SOCK_DGRAMSOCK_RAW)时,结果是相同的。

所以我的问题是:有没有办法利用'Winsock2'中定义的AF_UNIX,以便在Windows中实现类似于UNIX中的功能?

最佳答案

documentation on MSDN for the socket function说:

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.

因此,除非您安装了第三方服务提供商,否则无法使用AF_UNIX

关于windows - 我可以通过什么方式在Windows中使用Winsock2中定义的AF_UNIX,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16418798/

相关文章:

c++ - 澄清 : Porting 32 to 64 bit

php - 在 Windows Server 系统上托管 php 应用程序。有什么问题/建议吗?

apache-flex - 将预先存在的项目从 Flash 7/AS2 迁移到 Flex/AS3 的最佳方法是什么?

无法在 linux 和 windows 中编译 pgbouncer

Python 找不到我的文本文件?

windows - 获取网站IP地址的批处理脚本?

C - 函数的隐式声明 "pthread_timedjoin_np"

linux - 部署守护进程的过程和位置

linux - c++在linux环境下调用.dll

linux - 什么Linux类相当于CStdioFile