Search code examples
c#wcfnamed-pipesinter-process-communicat

Inter-Process communication options


I need to subscribe inside one app for the event exposed by another app. I noticed that many people consider the using of WCF Named Pipes as the best practice. Am I right that if I choose WCF Named Pipes I'll have to use IIS?

And by the way, what options do I have in general?


Solution

  • Named pipes are one of the fastest way to do IPC (inter-process communication) on the same machine. The have existed for a long while (was NT4 the first OS?) and not specific for WCF.

    I would however not use WCF/Named pipes through ASP.NET as IIS do not use named pipes for it's communication. that means that your app will close if IIS have not received HTTP requests for a while.

    How you should host your IPC depends on the type of application. If you want to always have your server running you should host it in a windows service. Otherwise you could just include it in your desktop app.

    You do not necessarily have to use WCF, you can use named pipes directly (look at the link in the beginning of my message). It all depends on how complex your communication is.