进程间通讯选项 [英] Inter-Process communication options

查看:80
本文介绍了进程间通讯选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在一个应用程序内订阅另一个应用程序公开的事件. 我注意到许多人认为使用WCF命名管道是最佳做法. 如果我选择了WCF命名管道,我是否必须使用IIS?

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?

推荐答案

命名管道是在同一台计算机上进行IPC(进程间通信)的最快方法之一.它已经存在了很长时间(NT4是第一个操作系统吗?),并且不特定于WCF.

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.

但是,我不会通过ASP.NET使用WCF/命名管道,因为IIS不会使用命名管道进行通信.这意味着如果IIS一段时间未收到HTTP请求,您的应用程序将关闭.

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.

如何托管IPC取决于应用程序的类型.如果要始终让服务器运行,则应将其托管在Windows服务中.否则,您可以将其包含在桌面应用程序中.

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.

您不一定必须使用WCF,您可以直接使用命名管道(请查看消息开头的链接).这完全取决于您的交流有多复杂.

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.

这篇关于进程间通讯选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆