nanomsg / nng

nanomsg-next-generation -- light-weight brokerless messaging
https://nng.nanomsg.org
MIT License
3.64k stars 472 forks source link

windows 10 supports unix domain sockets - add an option to use it instead of named-pipes for `ipc://` #1698

Open alzix opened 8 months ago

alzix commented 8 months ago

we are experiencing issues with IPC sockets reliability on Windows. related issues #1175 and #1567 on macOS it works much more reliably. One of the differences between the two systems is that Windows uses named named-pipes for IPC, while UNIX domain sockets are used on macOS

Windows 10 supports UNIX domain sockets out of the box - https://devblogs.microsoft.com/commandline/af_unix-comes-to-windows/ Add a compile/runtime option to use UNIX domain sockets on Windows for IPC

gdamore commented 7 months ago

I'm going to hold on this for now -- but I think I might well do this. I'd like to update both legacy nanomsg and mangos to do this as well, because it is an interoperability problem.

One other idea is to add a new URL scheme and transport just for UNIX sockets. I am thinking about that too.

gdamore commented 7 months ago

This will be post 1.6.0. But I do intend to do it.

gdamore commented 4 months ago

So my plan of record is as follows:

  1. Add unix:// as a UNIX domain IPC URL. Will be available unconditionally when supported.
  2. Add winpipe:// as a new scheme that only supports Windows named pipes. Available on Windows and compatible with legacy IPC.
  3. Add a compile time option to select whether ipc:// is unix:// or winpipe:// - will default to winpipe:// for 1.x, but I think in NNG 2.0 will change the default to IPC because honestly named pipes are a pain in my arse and I want to kick them to the curb.

Mangos will probably grow the same scheme as well.

louislau86 commented 1 month ago

@gdamore Is there a chance to utilize shared memory for inter process communication on the local machine?

gdamore commented 1 week ago

Shared memory will be a new transport entirely. I don't have any immediate plans for this ... its complicated to do if you want to do it in a zero copy fashion. (Its easy to do if you accept data copies...)