开发者

If ChannelTerminatedException occurs in WCF, which event is raised Faulted or Closed?

Self desc开发者_Python百科riptive


Neither. The channel will still be in the Open state.

After processing an operation with IsTerminating set to True, the server will mark the session as terminated and subsequent calls will return a Fault with code SessionTerminated that is translated to a ChannelTerminatedException.

However, if this attribute is set on the client side then it will automatically set the channel to Closed after a call to that operation. If that happens, attempting to use the channel will raise an InvalidOperationException.

The only way to get that exception is for the client not to have that attribute set and to believe that the channel is still Open. WCF will not close the channel in response to that fault, so it will still be Open.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜