Fastest way to communicate between c++ and c#
We are building a new vision inspection system application. The actual inspection system needs to be c++ for开发者_如何转开发 a number of reasons. For that system we will be using Boost & Qt.
For our UI, we are currently looking at using WPF/C# for the UI and SQL based reports. The complicating factor that UI has to run both local on the same box as the c++ inspection system or remotely on another box if the inspection system has no monitor or keyboard.
Our concern is what is the fastest way to transfer data between the two systems? We are currently looking at a socket based system using Google protocol buffers for serialization. The protocol buffers will generate code for c++ and c#(jskeet/dotnet-protobufs).
Does anyone have any suggestions/experience?
If you're really looking for the fastest way to communicate with your c++ inspection system, then I would implement both cases. A local interface by using named pipes (see here Interprocess communication for Windows in C# (.NET 2.0)) and a remote interface using Google protocol buffers for situations where your inspection system don't have a keyboard and/or monitor attached. Then the UI first tries opening a named pipe on the local box and if that fails the user has to enter a remote address for socket communication.
Hope that helps a bit...
I would look at zeromq if you really want the fastest at least cost
精彩评论