Ivan
Ivan

Reputation: 64227

What's the right way to communicate between 2 or more .Net applications running on a same computer without using web services?

If my applications run on a same computer or even on different computers in a same LAN and need intense and quick communication, it seems illogical for me to use text-encoded web services and HTTP. I could possibly use IP/TCP/UDP sockets and invent my own protocols, but believe there is a standard way for .Net applications to send/receive object instances (and, maybe, even sharing an object by reference?). Can you tell me what's that standard way? I am only interested in .Net Framework 4 applications and don't need to support legacy frameworks.

Upvotes: 1

Views: 2219

Answers (6)

koppor
koppor

Reputation: 20551

To be future proof, I would use gRPC, which allows a) local communication between C# apps, b) local communication between apps in various languages and c) communication over network.

Upvotes: 0

Jesse C. Slicer
Jesse C. Slicer

Reputation: 20157

.Net 4 gives you the Memory-mapped File which you may back with the paging file and share between applications by name.

Upvotes: 1

kemiller2002
kemiller2002

Reputation: 115538

You'll want to use Windows Communication Foundation:
http://msdn.microsoft.com/en-us/magazine/cc163647.aspx

Another link on getting started with WCF

Microsoft has chosen this as their preferred method of communication for .net apps. It replaces Remoting and Web Services.

The great thing about it is that you can switch to different protocols with a small amount of work, so if one protocol doesn't work for you, you can change around the configuration to try another one.

Upvotes: 6

Jerod Venema
Jerod Venema

Reputation: 44652

In a word: remoting

http://msdn.microsoft.com/en-us/library/kwdt6w2k(VS.71).aspx

If performance is still an issue, TCP (or even UDP depending on requirements) is still your friend.

Upvotes: 0

Sebastian P.R. Gingter
Sebastian P.R. Gingter

Reputation: 6085

I you want to share objects, then .NET Remoting is probably a good way to achieve that.

Upvotes: 0

Brian
Brian

Reputation: 118925

Probably either WCF over NetTcp or NetNamedPipe bindings, or else .NET Remoting.

Upvotes: 1

Related Questions