Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

wcf implementation for interprocess communication

I have developed a .NET UI and windows service which communicate with each other using WCF through the NetNamedPipeBinding protocol. I chose NetNamedPipe because it is the best and efficient choice for interprocess communication on the same machine.

However, one of the key requirements of the application is that the UI should be able to send actions to the windows service and vice versa asynchronously. This means that the windows service should be able to call back the .NET UI application without the need for the .NET UI application to connect to the windows service first.

Keeping this in mind, I have hosted a WCF service in the windows service and a separate WCF service in the .NET UI application so that they can communicate asynchronously without the need to keep the communication channel always alive.

I would like to know if this makes good design sense.

I would appreciate your comments on the same.

Thanks in advance.

Subbu

like image 972
Subbu Avatar asked Jul 17 '26 16:07

Subbu


1 Answers

Hosting another WCF service in the client to receive calls from the main WCF service is not a good idea. You need to use WCF duplex communication (as Subbu posted) aka WCF callback.

WCF: Duplex Operations and UI Threads

like image 192
idemery Avatar answered Jul 20 '26 07:07

idemery