gpt4 book ai didi

wcf - NetTcpBinding.MaxConnections 是否限制到端点的并发连接数或......?

转载 作者:行者123 更新时间:2023-12-04 22:06:24 28 4
gpt4 key购买 nike

Book Essential WCF 声称 NetTcpBinding.MaxConnections 限制到端点的连接数。因此,如果属性值设置为 10,则该端点将只允许 10 个并发连接。

可是下面的博客http://kennyw.com/work/indigo/181声明此属性此属性不限制并发连接数,而是仅指定将被另一个 channel 缓存和重用的最大连接数:

MaxConnections for TCP is not a hard and fast limit, but rather a knob on the connections that we will cache in our connection pool. That is, if you set MaxConnections=2, you can still open 4 client channels on the same factory simultaneously. However, when you close all of these channels, we will only keep two of these connections around (subject to IdleTimeout of course) for future channel usage. This helps performance in cases where you are creating and disposing client channels. This knob will also apply to the equivalent usage on the server-side as well (that is, when a server-side channel is closed, if we have less than MaxConnections in our server-side pool we will initiate I/O to look for another new client channel).

那么哪个是真的?

编辑:

First of all, you mean NetTcpBinding.MaxConnections, right?

是的,谢谢...我已经更正了打字错误

See official docs at http://msdn.microsoft.com/en-us/library/system.servicemodel.nettcpbinding.maxconnections.aspx and especially http://msdn.microsoft.com/en-us/library/ms731078.aspx - the behavior is actually different depending if it's the server or the client, but in no case is it a hard limit on the number of connections. (On the client, it's a limit on the connections that are pooled, and on the server it's a limit on connections that haven't been accepted yet by the ServiceModel layer).

a) 我假设“合并”是指将被其他 channel 重用的连接数。但是博客说客户端和服务器都是这种情况,而如果我理解正确的话,你是说在服务器上它意味着等待 ServiceModel 层接受的连接数?

因此,如果属性设置为 10,那么将只允许 10 个连接等待被接受,如果另一个连接试图等待,它会立即被拒绝吗?

最佳答案

首先,您的意思是 NetTcpBinding.MaxConnections,对吧?

查看官方文档 http://msdn.microsoft.com/en-us/library/system.servicemodel.nettcpbinding.maxconnections.aspx特别是http://msdn.microsoft.com/en-us/library/ms731078.aspx - 行为实际上是不同的,具体取决于它是服务器还是客户端,但在任何情况下都不是对连接数的硬性限制。 (在客户端,它是对池化连接的限制,而在服务器上,它是对尚未被 ServiceModel 层接受的连接的限制)。

关于wcf - NetTcpBinding.MaxConnections 是否限制到端点的并发连接数或......?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4137216/

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