.net - WCF channel 故障状态是否有帮助?

标签 .net wcf channel

我无法将故障 channel 的概念映射回某些绑定(bind)的手动实现。我认为这个 WCF 功能很烦人,我想知道是否有任何方法可以禁用它。

以 TCP 为例。大多数 TCP 通信都断开了。那么到底为什么一个连接会导致 channel 故障并断开所有以下连接呢?

和命名管道?

也许我错了。所以请解释为什么它是一个特性,而不是一个错误。

最佳答案

我认为它是 Juval Löwy(WCF 架构师之一)WCF 整体哲学的产物。引用他的书 Programming WCF Services:

This [the exception system and the normal way of using it] is a fundamental flaw of .NET as a platform. [...] Here [after an exception is thrown], something totally unexpected and horrible has happened. How could the client possibly pretend otherwise? The object may be hopelessly broken, and yet the client keeps using it.



这个想法是,毕竟,您正在与您正在使用的任何传输 channel 的另一端的对象进行通信,如果该对象抛出异常,它可能不再可用。这是一个有趣的观点,但我不确定我是否完全同意(因为,正如你所说,这在实践中可能会很烦人)。

关于.net - WCF channel 故障状态是否有帮助?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5145398/

相关文章:

.net - 由于 SQL Server CE 错误,通过安装项目部署的应用程序崩溃

c# - UDPClient Async BeginReceive 很慢

c# - 哪些 .Net 程序集作为标准集成到 SQL Server 2008 R2 CLR 中?

.net - 返回流长度并包含输入参数的 WCF 流服务

go - channel 是否返回两个值?

java - Netty本地文件 channel 实现

go - go 中奇怪的 channel 行为

c# - Entity Framework 给出异常 : "The underlying provider failed on Open."

wcf - 为什么我的 WCF Web 服务在具有不同字段名称的不同命名空间中显示此对象?

c# - 将字节数组从 PHP 发送到 WCF