Replacing WCF for Cross Process / Machine Message

I am working on a C # application that contains several Windows services that will need to communicate with each other to transfer data. These services may be located on the same machine, but they may be deleted. I was considering using WCF for this purpose, but it seems that WCF is too heavy and has a lot of extra configuration that seems unnecessary to me (.NET 3.5 is a requirement here, I know .NET 4 simplified this)

So my question is: what would be the best WCF replacement besides the legacy .NET Remoting that provide this functionality?

+7
source share
3 answers

I have been using PInvoke to access the Windows RPC runtime for almost 8 years. He is angry and very reliable as far as transport goes. Combined with a fast serializer such as protobuf-csharp-port, the resulting communications are carbide and very fast .

So, to build it from scratch, it will require three parts:

All of them are available on NuGet in the following packages: Google.ProtocolBuffers , CSharpTest.Net.RpcLibrary, and Google.ProtocolBuffers.Rpc .

Below is a quick start to getting started:

  • Define a message set and service using the Google Buffer Language .

  • Once you have determined this, you run ProtoGen.exe to create service stubs and messages in C #. Be sure to add "-service_generator_type = IRPCDISPATCH" to create the correct utility code.

  • Now that you have the generated source files, add them to the project and refer to the three builds from the packages listed above.

  • Finally, see the sample client / server code on the protobuf-csharp-rpc project page. Replace "SearchService" with your service name, and you should be ready to start.

  • Change the client / server RPC configuration as necessary. This example shows the use of LRPC, only the local host; however, the source file DemoRpcLibrary.cs shows TCP / IP and named pipes.

You can always email me (roger @ my username) for more information or examples.

Update

I wrote a quick start guide: replacing WCF to transfer data between processes / machine .

+14
source

You can look in ZeroMQ, it is very lightweight and efficient and comes with good C # connections. (By typing this on my mobile phone so that you now need to do it yourself, sorry).

+2
source

Check out the NFX Glue .

This is faster than WCF for connected systems.

Inter-process communication with glue block

Benchmark

Code: https://github.com/aumcode/nfx

0
source

All Articles