gpt4 book ai didi

connection - 如何以编程方式设置connectionManagement maxconnection?

转载 作者:行者123 更新时间:2023-12-02 05:00:56 26 4
gpt4 key购买 nike

如何以编程方式设置 maxconnection 值?

这是我的 app.config 中的条目。

<system.net>
<connectionManagement>
<add address = "*" maxconnection = "100" />
</connectionManagement>
</system.net>

另外,如何以编程方式设置 throttle ?
<serviceBehaviors>
<behavior name="defaultServiceBehavior">
<serviceThrottling maxConcurrentCalls="100"
maxConcurrentInstances="100" maxConcurrentSessions="100" />

最佳答案

我正在寻找相同的设置。对于第一个,以下似乎符合要求?那对你有用吗?

ServicePointManager.DefaultConnectionLimit = 200;

以及 httpwebrequest 对象的以下内容
webrequest.ServicePoint.ConnectionLimit = 200;

下面的链接显示了节流编程的示例

https://www.oreilly.com/library/view/programming-wcf-services/9780596157210/ch04s08.html

关于connection - 如何以编程方式设置connectionManagement maxconnection?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16408281/

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