I've built in C#, two-part software: one is a Windows-service that does some things, and the other is a Tray-Application to send commands to service but also receive messages from the service and notify the user.
For this communication, I made a WCF server (NamedPipes) in the windows-service, and the Tray-Application then connects and "subscribes" to receive messages.
In order for the Tray-Application to receive a notification from the service, the connection between them is a DuplexChannel. in DuplexChanel the client calls the server, and the server can execute a method on the client.
But now I understand that DuplexChannel is not really for that (i mean long listening from the client): by default, it is closed after a period of inactivity, and after I've set up a production mode, it closed after a long time or maybe sleep mode and so on. I gave up trying to solve the problems it creates (maybe I'm wrong).
the question:
What is the right - best way to send a message from the windows-service to a client(s) software in the same PC, A. Over long time (as long as the computer is running) B. In a way that allows multiple clients (because the Tray-Application is launched several times, once per user).