使用 .NET 获得快速 RPC 的最简单方法?

发布于 2024-07-27 12:51:18 字数 341 浏览 6 评论 0原文

在 .NET 中获取 RPC 最简单的方法是什么? 我看到有.NET Remoting和WCF,根据维基百科,WCF是.NET Remoting的后继者。

到目前为止,我只尝试了远程处理的东西,这似乎非常简单——到目前为止,我也没有遇到任何应用程序速度问题。 .NET 远程处理真的是让 RPC 工作的最佳方式吗?还是我应该研究一下 WCF(因为 .NET 远程处理将被停止,取而代之?)? 我只想与用 C# 编写的已知对象进行通信,因此我不需要任何 XML/SOAP/等。 传输格式的东西。 目标应用程序旨在分布在网络上,并且仅与其自身的实例进行通信。 在这种情况下,我只想连接到某个地方的对象,而不必处理协议级别的问题。

What's the easiest way to get RPC in .NET? I see that there is .NET Remoting and WCF, and according to Wikipedia, WCF is the successor to .NET Remoting.

So far, I only tried the remoting stuff, which seems to be pretty simple -- I also didn't hit any problem with the application speed so far. Is .NET remoting really the best way to get RPC working, or should I look into WCF (as .NET remoting is going to be discontinued in favor of it?)? I only want communication with already known objects written in C#, so I don't need any of this XML/SOAP/etc. transport format stuff. The target application is meant to be distributed over a network, and communicate only with instances of itself. In this context, I simply want to connect to an object somewhere, without having to deal with protocol level issues.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

抱着落日 2024-08-03 12:51:18

您可以使用具有二进制格式和 TCP 绑定的 WCF。 如果这(仍然)不够快,您将不得不考虑定制(非标准)技术。 对于一台机器上的通信,您可以使用 IPC 协议(类似于或基于命名管道)。

事实上,远程处理作为一种独立的技术正在消失。 它正在被 WCF 同化。

You can use WCF with binary formatting and TCP binding. If that (still) isn't fast enough you will have to look at custom (non standard) technologies. For communication on 1 machine you can use the IPC protocol (which is similar to or based on named pipes).

And indeed, Remoting is disappearing as a separate technique. It is being assimilated by WCF.

风筝在阴天搁浅。 2024-08-03 12:51:18

一旦我在某处读到关于 CP 的讨论,我认为有人证明使用管道的 WCF(它使您只能在同一台机器上进行 IPC)比 .Net Remoting 快得多,并且当使用 tcp 时 - 这是一个快一点。 我无法确认这对于所有情况都是正确的,但你可以通过谷歌搜索一些基准,我见过的很少。 在我看来,如果远程处理为您提供了所需的一切,那么您可以坚持使用它,至少现在是这样:)。

Once I've read a discussion somewhere, on CP I think, and someone was proving that WCF using pipes (which enables you to go IPC on the same machine only) is much faster then .Net Remoting, and when using tcp - it's a bit faster. I can't confirm it's true for all cases, but you can google for some benchmarks, I've seen few. In my opionion, if remoting gives you everything that you need, you can stick with it, at least for now :).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文