wshttpbinding 的 SessionMode.NotAllowed 与 maxConcurrentSessions

发布于 2024-11-25 03:42:41 字数 567 浏览 0 评论 0原文

serviceThrotdling 的服务属性 SessionMode.NotAllowed 和 maxConcurrentSessions 可以与 wshttpbinding 同时使用。

这是否意味着它们可能指的是两个不同的会话概念?

例如 SessionMode.NotAllowed = 无状态服务。
最大并发会话数 = 最大并发会话数并发(不同?)安全谈判。

编辑:
来自这个答案对另一个问题 我理解“WCF 将检查 app.config [maxConcurrentSessions] 是否与属性 [SessionMode.NotAllowed] 一致,如果它们一致,则拒绝启动服务不一致”。
当声明 SessionMode.NotAllowed 并且这会禁用会话时,WCF 是否应该因为与 maxConcurrentSessions 的配置相矛盾而拒绝启动服务?

The service attribute SessionMode.NotAllowed and maxConcurrentSessions of serviceThrottling can be used simultaneously with wshttpbinding.

Does this mean that they perhaps refer to two different concepts of session?

E.g.
SessionMode.NotAllowed = stateless service.
maxConcurrentSessions = max. concurrent (different?) security negotiations.

EDIT:
From this answer to another question I have understood that "WCF will check that app.config [maxConcurrentSessions] is consistent with attributes [SessionMode.NotAllowed] and refuse to start the service if they are not consistent".
When SessionMode.NotAllowed is declared and this disables the use of sessions, shouldn't WCF then refuse to start the service because of the contradicting configuration with maxConcurrentSessions?

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

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

发布评论

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

评论(1

不离久伴 2024-12-02 03:42:41

SessionMode.NoAllowed 表示合约必须以无状态方式实现。

对于 NetTcp,这将阻止服务以其固有的会话方式启动,对于 WSHttpBinding,它将抑制会话。

如果您使用 SessionMode.NotAllowed,则 maxConcurrentSessions 将不起作用,因为不会有任何 会话。限制

WSHttpBinding 的会话使用 SecureConversation 来支持其会话概念(如果可用)。如果不可用,它将使用可靠的消息传递(如果可用)。如果两者都不可用,则无法支持会话

我写了

更新响应编辑

安全对话和会话不一样 事物。无论您是否有会话,都可以使用安全对话。 WSHttpBinding 支持会话的一种方式是使用安全会话协商来定义会话。但是,如果您说 SessionMode.NotAllowed,那么 WCF 将根本没有 sessionID 并且不支持会话 - 这并不意味着它不会使用安全会话

maxConcurrentSessions 限制并发会话的最大数量。如果关闭会话,则会话数将为 0,因此始终小于最大会话数

SessionMode.NoAllowed says that the contract must be implemented in a stateless way

For NetTcp this would prevent the service starting as its inherently sessionful, for WSHttpBinding it will suppress the session

maxConcurrentSessions will have no effect if you use SessionMode.NotAllowed as there will be no sessions to throttle

WSHttpBinding uses SecureConversation to support its concept of session if its available. If its not available it will use reliable messaging if its available. If neither are available it cannot support session

I wrote a blog article about this stuff a while back

Update in Response to Edit

Secure conversation and Sessions are not the same thing. Secure Conversation can be used whether or not you have sessions. One way WSHttpBinding supports session is to the use the negotiation of secure conversation to define the session. However, if you say SessionMode.NotAllowed then WCF will simply not have a sessionID and not support session - it doesn't mean it won't use secure conversation

maxConcurrentSessions limits the maximum number of concurrent sessions. If you turn off session then the number of sessions will be 0 and so will always be less than the maximum

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