WCF - 最快的进程间通信 [英] WCF - Fastest interprocess communication

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

问题描述

一个拥有网络访问(通过basicHttpBinding的)WCF服务,我也想从其他.NET服务,访问同一台机器上更高的性能越好。据我所知,netNamedPipeBinding非常适合这一点,但想知道最好的配置将被赋予什么我只甚至将与其他.NET程序进行通信。

A have a web-accessible (via basicHttpBinding) WCF service which I also want to access from other .NET services on the same machine with as higher performance as possible. I understand that the netNamedPipeBinding is ideal for this, but wonder what the best configuration would be given that I'm only even going to be communicating with other .NET processes.

例如,我不一定要使用的编码,如SOAP,因为这也许是太笨重,我并不需要具有比其他任何其他客户端兼容性.NET客户端。我不认为我不需要任何的安全性。

For example, I needn't necessarily use an encoding such as SOAP as this is perhaps too bulky and I don't need the compatibility with any other clients other than a .NET client. I also don't think I need any security.

会是怎样实现这一目的的最佳结合配置(或任何其他配置为此事)

What would be the best binding configuration for this purpose (or any other configurations for that matter)

推荐答案

正如你所提到的,的 NetNamedPipeBinding 约束力的同一台计算机通信进行了优化:

As you have noted, the NetNamedPipeBinding binding is optimised for same-machine communication:

提供了一个安全,可靠的约束力
是上机
通信进行了优化。

Provides a secure and reliable binding that is optimized for on-machine communication.

参考。 :系统提供的绑定

在Juval洛伊的书的一章,编程WCF服务,他提供了一个有用的决策活动图选择正确的绑定:

In chapter one of Juval Lowy's book, "Programming WCF Services", he provides a useful decision-activity diagram for choosing the right binding:

第一个问题,你应该问
你自己是你的服务是否需要
与非WCF客户端交互。如果
答案是肯定的,如果客户端
是一个遗留MSMQ客户端,选择
MsmqIntegrationBinding,使
你的服务进行互操作过MSMQ
这样的客户端。如果您需要
与非WCF客户端和$ b $互操作b客户端预计基本的Web服务
协议(ASMX Web服务),选择
的basicHttpBinding的,这暴露了
WCF服务向外界
就好像它是一个ASMX网服务
(即一个WSI-基本配置文件)。在
缺点是,你不能把大多数的现代WS- *
协议
的优势。然而,如果非WCF
客户端可以理解这些标准,
选择了WS绑定,比如
的WSHttpBinding,
WSFederationHttpBinding,或
WSDualHttpBinding之一。如果您可以假设
客户端是一个WCF客户端,但
它需要脱机或断开
交互,选择使用MSMQ运送的
消息NetMsmqBinding
。如果客户需要连接的通信
,但也可以是
调用跨越机器边界,
选择NetTcpBinding的那
通过TCP通信。如果客户端
是同一台机器上的服务,
选择NetNamedPipeBinding是
使用命名管道,最大限度
性能。您可能会微调的基础上额外
标准,如需要
回调(WSDualHttpBinding)或
联合安全
(WSFederationHttpBinding)结合
选择。

"The first question you should ask yourself is whether your service needs to interact with non-WCF clients. If the answer is yes, and if the client is a legacy MSMQ client, choose the MsmqIntegrationBinding that enables your service to interoperate over MSMQ with such a client. If you need to interoperate with a non-WCF client and that client expects basic web service protocol (ASMX web services), choose the BasicHttpBinding, which exposes your WCF service to the outside world as if it were an ASMX web service (that is, a WSI-basic profile). The downside is that you cannot take advantage of most of the modern WS-* protocols. However, if the non-WCF client can understand these standards, choose one of the WS bindings, such as WSHttpBinding, WSFederationHttpBinding, or WSDualHttpBinding. If you can assume that the client is a WCF client, yet it requires offline or disconnected interaction, choose the NetMsmqBinding that uses MSMQ for transporting the messages. If the client requires connected communication, but could be calling across machine boundaries, choose the NetTcpBinding that communicates over TCP. If the client is on the same machine as the service, choose the NetNamedPipeBinding that uses named pipes to maximize performance. You may fine-tune binding selections based on additional criteria such as the need for callbacks (WSDualHttpBinding) or federated security (WSFederationHttpBinding)."

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

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