简体   繁体   中英

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...

如果你真的想要最快的成本,我会看看zeromq

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM