惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
罗磊的独立博客
T
The Blog of Author Tim Ferriss
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
Last Week in AI
Last Week in AI
美团技术团队
Google Online Security Blog
Google Online Security Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
D
Docker
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
酷 壳 – CoolShell
酷 壳 – CoolShell
小众软件
小众软件
月光博客
月光博客
L
LINUX DO - 最新话题
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
W
WeLiveSecurity
H
Heimdal Security Blog
Vercel News
Vercel News
SecWiki News
SecWiki News
Forbes - Security
Forbes - Security
Blog — PlanetScale
Blog — PlanetScale
Google DeepMind News
Google DeepMind News
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
TaoSecurity Blog
TaoSecurity Blog
T
Troy Hunt's Blog
A
About on SuperTechFans
C
Check Point Blog
S
Security Affairs
Hacker News - Newest:
Hacker News - Newest: "LLM"
AI
AI
WordPress大学
WordPress大学
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Help Net Security
Help Net Security
博客园_首页
The Last Watchdog
The Last Watchdog
S
SegmentFault 最新的问题
Hugging Face - Blog
Hugging Face - Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
Engineering at Meta
Engineering at Meta
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
I
Intezer
K
Kaspersky official blog
M
MIT News - Artificial intelligence
J
Java Code Geeks
G
GRAHAM CLULEY
P
Palo Alto Networks Blog

博客园 - 孤峰皓月

OD 基础 Fiddler 抓取Https时 显示 Tunnel to 443 的解决方案2 Fiddler 抓取Https时 显示 Tunnel to 443 的解决方案 Fiddler 模拟器抓包,SSL抓包不到 新浪微博视频批量上传社区投稿教程 windows 2008 R2 设置 discuz 伪静态 微信小程序-布局 微信小程序,体验版加载不了网络数据 微信小程序: 使用本地缓存 微信小程序 自定义组件. 小程序学习一些小技巧 微信小程序基础学习笔记4 微信小程序基础学习笔记3:API 微信小程序基础学习笔记2:数据绑定相关 微信小程序基础学习笔记1 cad 已知拱高弦长求弧长 MySQL直接将数据库的文件夹从服务器复制到本地,打开表提示需要修复 “is marked as crashed and should be repaired ” 富文本编辑器,webbrowser控件 document.execCommand() 解析 Visual studio 2010 工具箱名称不显示的原因
HttpWebRequest.GetRequestStream方法timeout【第3次操作时就超时】的原因及解决办法
孤峰皓月 · 2021-01-23 · via 博客园 - 孤峰皓月

最近在使用HttpWebRequest时,发现对某些网站GetRequestStream只能发两次,第三次开始就会超时,抛出异常,而对另一些网站则完全没有问题。

1 Stream stmRequest = httpRequest.GetRequestStream();     
2 stmRequest.Write(btData, 0, btData.Length);     
3 stmRequest.Close();  

这个问题让我相当郁闷,不知该从哪下手解决,因为找不到原因。后来,在网上查了些资料,有人说这是一个bug,但似乎不太可能,因为HttpWebRequest这个类由来已久,从.NET Framework 1.0时就已经存在了。
最后,终于在这里找到了答案  http://www.dotnetmonster.com/Uwe/Forum.aspx/dotnet-compact-framework/5443/Timeout-in-HttpWebRequest-GetRequestStream
问题产生的原因是我在后面的代码里用GetResponseStream生成了一个stream以读取返回结果,但却一直没有关掉。。。

HttpWebResponse httpResponse = (HttpWebResponse)httpRequest.GetResponse();     
Stream stmResponse = httpResponse.GetResponseStream(); 

解决办法,当然是要在使用完这个stream后将其关掉了: