Inter-Process communication options

别说谁变了你拦得住时间么 提交于 2019-12-30 18:30:49

问题


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?


回答1:


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.




回答2:


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?

No, not really. Although this is an option but you have other options as well. Like,

  • Self-Hosting Your Service
  • Hosting in Windows Services
  • Hosting Using Internet Information Services (IIS)

    which you can read in detail here.

Named pipes existed even before WCF and WCF is certainly not the only way to use them



来源:https://stackoverflow.com/questions/18437474/inter-process-communication-options

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!