gpt4 book ai didi

wcf - 如何为单向方法启用可靠性?

转载 作者:行者123 更新时间:2023-12-04 18:22:01 25 4
gpt4 key购买 nike

What You Need To Know About One-Way Calls, Callbacks, And Events文章讲述:

The fact that the client doesn't care about the result of the invocation does not mean the client doesn't care if the invocation took place at all. In general, you should turn on reliability for your services, even for one-way calls

我试图找出如何实现可靠性,但没有找到任何有意义的东西。

你能帮帮我吗:

  1. 如何实现可靠性?
  2. 如何检查单向方法是否到达服务器?

非常感谢!

最佳答案

我假设您指的是链接文章的作者 Juval Lowy 在“Programming WCF Services”中描述的消息可靠性(因此书中也逐字逐句地引用了这句话)。

可靠性仅对某些绑定(bind)有效。以这个 TCP 绑定(bind)为例。在你的配置文件中:

<binding>
<netTcpBinding>
<binding name="MyTcpBinding">
<reliableSession enabled="true" />
</binding>
</netTcpBinding>
</binding>

为了检查可靠性,我将引用这本书(第 66 页):

Message reliability does not guarantee message delivery. All it provides is a guarantee that if the message does not reach its destination, the sender will know about it.

我不知道发件人是怎么知道的,我从来没有遇到过,但希望它能给你更多的洞察力,让你更深入地研究这个话题。

进一步阅读:

http://msdn.microsoft.com/en-us/library/ms733136.aspx

关于wcf - 如何为单向方法启用可靠性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5318192/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com