I am writing a service (daemon) that suppose to run on both *nix and Windows. The service part will have a xxxctl
companion program that will need to trigger actions in service and receive a feedback from it.
I have initially looked at signals, however these have 2 problems:
- they do not seem to be really cross-platform (there are platform specific caveats)
- they do not offer any way to communicate from signal recipient back to initiator (in C/C++ recipient will see which PID send signal, in Go this is not exposed unless implemented manually using cgo)
I am currently looking towards unix sockets and named pipes. Each respectively available only in their world, which means added complexity to application and dealing with that.
My question is -- other than IP sockets, is there any other option left for organizing IPC communication in cross-platform way using Go?
PS: I would like to avoid using cgo and/or IP sockets as much as possible, though do not completely reject this idea.