简体   繁体   English

.NET远程处理和用于本地/ LAN通信的WCF / TCP有什么区别?

[英]What is the difference between .NET remoting and WCF/TCP for local/LAN communication?

OK, so I know that WCF is supposed to replace dotNET remoting , yet I seem to fail to really grasp if WCF is a full replacement with more options, or if .NET remoting offers some features that are missing from WCF? 好的,所以我知道WCF应该取代了dotNET远程处理 ,但是我似乎无法真正把握WCF是否可以用更多选项进行完全替代,或者.NET远程处理是否提供了WCF缺少的某些功能?

As the title hints at, I do not need any of that Web* stuff. 如标题所示,我不需要任何Web *东西。 The use case is having a C# desktop application expose an RPC-ish interface to make it possible for other programs to communicate with / control the application. 用例是让C#桌面应用程序公开RPC-ish接口,以使其他程序可以与该应用程序通信/控制该应用程序。 Number of possible clients is probably < 10 and communication is exclusively local network. 可能的客户端数量可能小于10,并且通信完全是本地网络。

I found this question that asks for something similar, but this other question seems to imply that .NET-remoting can in fact be used in ways that WCF does not offer. 我发现这个问题要求类似的内容,但另一个问题似乎暗示.NET远程处理实际上可以WCF无法提供的方式使用。

There's no concept of "marshal by reference" in WCF, by design. 根据设计,在WCF中没有“按引用编组”的概念。 Whether marshal-by-reference is ever a good idea is another matter, but regardless it's a major .NET Remoting feature that doesn't exist in WCF. 通过引用进行封送是否是一个好主意,这是另一回事,但是不管它是WCF中不存在的主要.NET Remoting功能。

Use WCF with the self-hosted option (within the desktop application). 将WCF与自托管选项一起使用(在桌面应用程序内)。 Expose net.tcp binary endpoints assuming all other clients are .NET. 假定所有其他客户端均为.NET,则公开net.tcp二进制终结点。

Check the sample "Form Host" on the iDesign downloads page: http://www.idesign.net/idesign/DesktopDefault.aspx?tabindex=5&tabid=11 在iDesign下载页面上检查示例“表单主机”: http : //www.idesign.net/idesign/DesktopDefault.aspx? tabindex=5&tabid =11

WCF is full replacement for .net remoting. WCF完全替代了.net远程处理。 Your scenario is perfectly valid for WCF. 您的方案对WCF完全有效。 You will easily complete it after reading few tutorials. 阅读一些教程后,您将轻松完成它。 All the mentioned use cases are controversial, I see no reason in using remoting nowadays. 所有提到的用例都存在争议,我认为现在没有理由使用远程处理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM