1

I'm developing an application to monitor information of our software suite, so i'll only have access to modify code from my own project, and the other half will depend on the suite programmers. The programs will all be running on the same computer, with the monitoring software running as a service.

One of the things i'm curious as to which route to take, is how to share or pass information between the applications or processes. Let's just say it's not important what type the data is, whether i send bytes, or a string or so on (Even though deep down it's all the same).

Opening a TCP/IP listener / connection to send data to the same computer seems overkill, just to listen on a certain port to recieve the information. What other options are there? I've taken a little look into data maps, but my only concern is that the suite is written in delphi, so i'm not sure of compatability between c# and delphi for accessing the datamap (Can delphi even do such a thing is a research point i'll look into).

So my question is, in a TL;DR kinda manner, what options are there for transporting data on an inter-process level?

Kestami
  • 2,045
  • 3
  • 32
  • 47

3 Answers3

2

I'd have a look at WCF (using named pipes), it's ideal for inter application communication.

NDJ
  • 5,189
  • 1
  • 18
  • 27
1

In this case I would probably use the monitoring service as a means to communicate between your clients (using a polling system, for example), and use NetNamedPipeBinding for cross-process communication on the same machine. See http://msdn.microsoft.com/nl-be/library/ms752247.aspx.

See also How can I communicate with WCF from Delphi using Named Pipes Binding concerning communication with WCF from a Delphi application.

The advantage of this approach is that you could easily extend it to a centralized system where you have a backend and multiple clients, if ever needed.

Community
  • 1
  • 1
L-Four
  • 13,345
  • 9
  • 65
  • 109
1

You have many options here. I'd look into named pipes for fast, efficient inter process communication. However there is another option which springs to mind, and that is WMI

What you would do, is to implement a WMI provider in your Delphi program where you publish your monitoring data. Then your monitoring service would read the data using WMI queries.

This has a few advantages. It does not enforce any limitations on your deployment setup, because its just as viable to query WMI remotely as locally. Thus, even though you aim for a local solution now, you could easily adapt to a remote setup later, simply by calling WMI remotely instead of locally.

It also allows the processes to work independently of each other, such that you can publish stats at whatever rate you want from your Delphi suite, and poll independently from your monitoring service. There is even some event support here.

havardhu
  • 3,576
  • 2
  • 30
  • 42