This question already has answers here:
What is the best choice for .NET inter-process communication? [closed]
(8 answers)
Closed 6 years ago.
I can come up only with serialization, using of WCF, etc.
But is there the standard common way for communication between 2 processes in .Net?
UPDATE: What I actually mean how to communicate between 2 processes locally when I do not need to use WCF, Remoting and network at all. Are there some ways of doing it? And I am interesting in more elegant ways than storing data to HDD or to database.
With no other information, I would suggest using WCF with a named pipes configuration:
What is the best choice for .NET inter-process communication?
You can also look at .NET Remoting. But for all intents and purposes you shouldn't be using it unless you have explicit requirements that are satisfied by remoting like...in-process, cross-appdomain communication.
I would just look at WCF's NetNamedPipeBinding. It sounds like it's exactly what you want: http://www.codeproject.com/KB/WCF/wcfipcsample.aspx
Also it seems this question has already been answered:
Interprocess communication for Windows in C# (.NET 2.0)
C# - WCF - inter-process communication
Related
This question already has answers here:
What is the simplest method of inter-process communication between 2 C# processes?
(9 answers)
Closed 7 years ago.
How to pass value from a Windows desktop application to another Windows desktop application?
I'm stuck right now. I don't want to build two different forms in one Winform application.
I need two different Winform application that communicates with each other, one of them send value to other one and the receiver processes the data.
Anyone knows how to do that?
I'd be grateful if you can help.
You need to implement interprocess communication, Please check this link What is the simplest method of inter-process communication between 2 C# processes?
in this link you can find multiple options to implement interprocess communication such as:
Windows Communication Foundation
Windows Messages
Also you can use WCF for communicating between applications. Have look WCF - Fastest interprocess communication
If you are familiar with Remote Objects using Services (.Net Remoting), then your two application can communicate using this method.
You can refer to this link:
https://www.daniweb.com/software-development/csharp/code/227615/simple-net-remoting-demonstration
This question already has answers here:
Calling WCF Service from MS Access
(2 answers)
Closed 7 years ago.
We have a WCF Service and now we are having to suppor tit in backward compatibility mode. One of the consumer turns out to be an Access Application. Now, I have personally never worked with Access and not sure if Access has a direct way to consume the WCF services. However, I came across following link:
http://jaliyaudagedara.blogspot.com/2014/02/calling-wcf-service-from-stored.html?m=1
Given the fact that I would be more comfortable working with SQL Server rather than doing any work in Access to do backward compatibility, I found this link as my best shot to backward compatibility.
Are there any other ways that I can approach this problem?
This question has already been asked and answered here:
Calling WCF Service from MS Access
In short, you can call a WCF service exposed via WebHttpBinding (simple HTTP) or BasicHttpBinding (SOAP/HTTP) using XMLHttp (for simple HTTP) or the SOAP Toolkit (for SOAP/HTTP).
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I see there are some other posts related to this issue. However, I want to ask if there is new elegant way to just exchange some messages between a C#.net application and a C++ application?
They are running on the same machine.
Thanks in advance.
What you want is inter-process communication (IPC), which is language-agnostic by definition.
Typical solutions include:
Named pipes (also called FIFOs)
Mail slots
File mapping
Sockets
RPC
etc.
You use different ones depending on your needs.
Here is information on windows-supported IPC methods: http://msdn.microsoft.com/en-us/library/windows/desktop/aa365574%28v=vs.85%29.aspx
Most of this functionality is exposed in C# through WCF, which is windows-specific of course. If you're using Mono, you're out of luck.
C++ doesn't define any IPC constructs in the language itself, so you will have to use platform-specific libraries regardless.
Search around for IPC examples in C# and C++ and you will get plenty of hits.
Here's a SO post to get you started: IPC Mechanisms in C# - Usage and Best Practices
I have always used sockets, that is the simplest way I can think of (not the most elegant though)
There are many mechanisms you can use to do this.
This article enumerates the common ways to accomplish interprocess communication on the windows platform. Most if not all are possible form both C# and C++ (though I would hate to see you use DDE from C#, though it has apparently been done).
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I am getting a headache with standard socket class of .NET framework.
Could anybody recommend an efficient open source C# sockets (TCP + UDP) library for handling socket messages?
Use Kerry Jiang's SuperSocket library or Akka.NET
SuperSocket nuget package has over 100k downloads; note that 2.0+ is for .NET Core, whereas 1.6 is for .NET Framework 4.8 and below
SuperSocket.ClientEngine.Core has over 700k downloads
Akka (for .NET) has over 1.2M downloads, and has a special Akka.NET.Test
In a sense this is cheating because it postpones the decision of using sockets to the last moment
"Akka" started out as a Java/Scala project and was later to .NET
Therefore, you should Google search for "Akka.NET" instead of just "Akka"
In general, you probably want to construct your Network IO with some solution for back pressure, which you can do with Akka Async Streams in C# 8.
RSocket is a new library built by ex-Netflix engineer Robert Roeser.
Similar to Akka Streams in that it provides a way to handle backpressure.
Separately, in terms of using message queuing libraries instead of socket libraries:
EasyNetQ nuget package has over 4M downloads
NetMQ nuget package has over 600k downloads
ZeroMQ nuget package has over 80k downloads
I've used this in a real world project and it works fine, but it's a binding wrapper around a C dll
NetMQ is great for simple socket communication. It handles the reconstruction of messages and much of the messy details. It's meant for message communications as in a messaging system, but it would work great for simple sockets. Take a look at Request-Response. Sockets are one of the areas where you do often end up with framework on top of framework, regardless, let NetMQ handle the nitty gritty.
Take a look at WCF which is included in .NET.
I made sample application in for console/win app based C# WCF/TCP socket server/client here
https://github.com/evaldsurtans/wcf-sample-server-client
The .NET framework is already a library for handling tcp and udp. It simplifies the process greatly over the base winsock apis. So you want a library that sits on top of the library? Maybe you would then want another library on top of that? And another on top of that one?
My point is, you're likely not going to find anything simpler than what the .net framework already provides. Sockets are a complex topic, and requires that you provide a great deal of implementation yourself.
What a library is often useful for is implementing some already established protocol (like SMTP or FTP), or maybe even giving you more tools to create your own protocol.
This question already has answers here:
What is the best choice for .NET inter-process communication? [closed]
(8 answers)
Closed 9 years ago.
I currently have two programs that need to comunicate one with another. It doesn't have to be something complicated, it's just passing data from one to another, all very simple. I was thinking of using .net remoting, but I've heard there's a new thing WCF. Should I go for the .net remoting or try WCF? Or is there something simpler to use?
edit: Both applications are simple, I don't want to have anything to do with IIS, services and such.
Thanks
use WCF with named pipes binding, here you can find useful examples
The magic phrase is "inter-process communication". Then you'll be able to find answers like this.
WCF has a bit of a learning curve, but it's a very powerful communication framework. If you have some time to learn it, I'd recommend that over .NET remoting.
If you just need a super-simple mechanism, you could just write data to a file, then read it from the other program (assuming same machine). If it has to go over the network, using a plain Socket in .NET isn't too bad.
I've used .Net remoting for this in the past, and its worked very well for me. Its very simple and straightforward for something like you describe.
If you look into WCF now, I really don't think you would regret later. WCF is great and useful for this purpose.
If you want something really simple, just put the data in a database or a file.