I have an application that I wish to use over windows. I am using AF_UNIX family un windows. I wish to know that AF_UNIX family is available in windows. If not then is there any alternate to AF_UNIX ?
Thanks Arpit
Unix sockets allow inter-process communication (IPC) between processes on the same machine. In practice that means that all recent builds of Windows 10 support Unix sockets, plus Windows 11, of course.
The AF_UNIX (also known as AF_LOCAL) socket family is used to communicate between processes on the same machine efficiently. Traditionally, UNIX domain sockets can be either unnamed, or bound to a filesystem pathname (marked as being of type socket).
To create a UNIX domain socket, use the socket function and specify AF_UNIX as the domain for the socket. The z/TPF system supports a maximum number of 16,383 active UNIX domain sockets at any time. After a UNIX domain socket is created, you must bind the socket to a unique file path by using the bind function.
Edit: since about 2018, Windows 10 supports AF_UNIX.
https://devblogs.microsoft.com/commandline/af_unix-comes-to-windows/
Old answer:
Just use TCP sockets, they behave very much like UNIX sockets.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With