What is the easiest way to do inter process communication between c# and c?

时间:2017-12-18 08:26:43

标签: c# c ipc

I have one C# application and C application and I want the C# application to send 2 integers to the other 1(c)

What's the easiest way to do this? (It doesn't have to be the most elegant one) My C# application is hosted on a Ubuntu operating system.

Any help would be greatly appreciated.

1 个答案:

答案 0 :(得分:1)

If the purpose is only to send the parameters or values to a C function, I can suggest that you consider using P/Invoke. Then you talk about Ubuntu operating system, which suggests you either would be using Mono or .NET Core; consider reading this Native Interoperability — in case of Mono, this would help.

COM and other interops would require that you write C programs in a way that they can expose themselves out to the .NET framework. If writing the libraries as exposed, is not possible (such as precompiled libraries), then you would be able to have this done using named pipes. They are the pipes, which are used for communication within processes.