1.问题出现场景
当网站内部有多个线程同时启用httpwebrequest请求数据时,在GetRequestStream 方法时出现操作超时
2.解决方案
在webconfig 里面配置
<system.net>
<connectionManagement>
<add address = "*" maxconnection = "512" />
</connectionManagement>
</system.net>
其中的maxconnection可根据需要进行设置
本文介绍了解决多个线程同时使用HTTPWebRequest请求数据时出现的操作超时问题。通过在webconfig中配置connectionManagement节点,设置maxconnection参数为512(可根据需求调整),有效避免了超时情况的发生。

4158

被折叠的 条评论
为什么被折叠?



