Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 454
photo_tom Avatar asked Nov 14 '22 06:11

photo_tom


1 Answers

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

like image 108
VitaminCpp Avatar answered Dec 17 '22 05:12

VitaminCpp