I want to know how to use something that behaves like Unix Domain Socket on Windows.
The behaviour is: A process will be a "server" and receive connections from other processes and it can keep and use connections from different processes, as a TCP socket does.
IP socket is not a solution, because it requires to choose a port, processes from other applications may need the chosen port, and the open port may be seen in the network.
I do not know if named pipes can receive and keep multiple clients, but I did not see how to distinguish different clients. And it does not provide a way to wait data from multiple connections with something like select.
An old question says about using named pipes, but it does not explain how to use named pipes to get the desired behaviour. AF_UNIX in windows
I did not see how to get the handle of a specific client.
Windows has recently (Windows 10 Insider build 17063) implemented support for AF_UNIX, so you can use it in future windows builds.
However not all of it is implemented, the below features don't work.
- AF_UNIX datagram (SOCK_DGRAM) or sequence packet (SOCK_SEQPACKET) socket type.
- Ancillary data: Linux's unix socket implementation supports passing ancillary data such as passing file descriptors (
SCM_RIGHTS
) or credentials (‘SCM_CREDENTIALS`) over the socket. There is no support for ancillary data in the Windows unix socket implementation.- Autobind feature (see the section on ‘sockaddr_un’ for details).
- socketpair: socketpair socket API is not supported in Winsock 2.0.
Source: https://blogs.msdn.microsoft.com/commandline/2017/12/19/af_unix-comes-to-windows/