且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Windows 中的 AF_UNIX

更新时间:2023-01-03 18:32:56

编辑:大约从 2018 年开始,Windows 10 支持 AF_UNIX.

Edit: since about 2018, Windows 10 supports AF_UNIX.

https://devblogs.microsoft.com/commandline/af_unix-comes-to-windows/

旧答案:

只需使用 TCP 套接字,它们的行为与 UNIX 套接字非常相似.

Just use TCP sockets, they behave very much like UNIX sockets.

或者您可以使用命名管道并使用 WaitForMultipleObjects() 而不是 select()poll().Windows 命名管道与 UNIX 中的命名管道不太一样.Windows 命名管道是双向的,因此更像是 AF_UNIX 套接字而不是 UNIX 中的命名管道.

Or you can use named pipes and use WaitForMultipleObjects() instead of select() or poll(). Windows named pipes are not quite like named pipes in UNIX. Windows named pipes are bi-directional and thus more like AF_UNIX sockets than named pipes in UNIX.