lockup

WebRequest.GetResponse locks up?

戏子无情 提交于 2019-11-27 20:49:27
When writing the below my code locks up on GetResponse. Why? try { WebRequest myWebRequest = WebRequest.Create(strURL); WebResponse myWebResponse = myWebRequest.GetResponse(); //more code here This usually happens if you've made several requests to the same host, and not disposed of the WebResponse . The default connection management settings only allow 2 (or maybe 4, I can't remember) open connections to the same host at a time. If you really need to change this, use the <connectionManagement> app.config element - but usually you'll be fine just disposing of WebResponse : try { WebRequest

WebRequest.GetResponse locks up?

北城余情 提交于 2019-11-26 23:00:04
问题 When writing the below my code locks up on GetResponse. Why? try { WebRequest myWebRequest = WebRequest.Create(strURL); WebResponse myWebResponse = myWebRequest.GetResponse(); //more code here 回答1: This usually happens if you've made several requests to the same host, and not disposed of the WebResponse . The default connection management settings only allow 2 (or maybe 4, I can't remember) open connections to the same host at a time. If you really need to change this, use the