WebClient “error getting response stream”

耗尽温柔 提交于 2019-12-11 08:19:29

问题


I've just got an error report from a client using a program I wrote, and I've been googling the nuts off of this error and can't find anything useful. The error is:

System.Net.WebException: Error getting response stream (ReadDone2): ReceiveFailure ---> System.Exception:    at System.Net.WebConnection.HandleError(WebExceptionStatus st, System.Exception e, System.String where)
   at System.Net.WebConnection.ReadDone(IAsyncResult result)
  at System.Net.WebConnection.HandleError (WebExceptionStatus st, System.Exception e, System.String where) [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0 
  at System.Net.HttpWebRequest.GetResponse () [0x00000] in <filename unknown>:0 
  at System.Net.WebClient.GetWebResponse (System.Net.WebRequest request) [0x00000] in <filename unknown>:0 
  at System.Net.WebClient.DownloadFileCore (System.Uri address, System.String fileName, System.Object userToken) [0x00000] in <filename unknown>:0 
  at System.Net.WebClient.<DownloadFileAsync>m__F (System.Object state) [0x00000] in <filename unknown>:0 

System.Net.WebException: Error getting response stream (ReadDone2): ReceiveFailure ---> System.Exception:    at System.Net.WebConnection.HandleError(WebExceptionStatus st, System.Exception e, System.String where)
   at System.Net.WebConnection.ReadDone(IAsyncResult result)
  at System.Net.WebConnection.HandleError (WebExceptionStatus st, System.Exception e, System.String where) [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0 
  at System.Net.HttpWebRequest.GetResponse () [0x00000] in <filename unknown>:0 
  at System.Net.WebClient.GetWebResponse (System.Net.WebRequest request) [0x00000] in <filename unknown>:0 
  at System.Net.WebClient.DownloadFileCore (System.Uri address, System.String fileName, System.Object userToken) [0x00000] in <filename unknown>:0 
  at System.Net.WebClient.<DownloadFileAsync>m__F (System.Object state) [0x00000] in <filename unknown>:0

The application is the launcher program for a game, it pulls down a manifest of files and patches any which are non-existent or outdated. All the files it downloads with a WebClient object, it looks like the error is being thrown by WebClient::DownloadFileAsync, but I can't find any documentation as to why this could be happening.

Any help would be much appreciated, the quicker I can fix this monday morning the better!

Cheers Joe


回答1:


Does the client uses a proxy?

If yes, are you attaching the proxy to the WebClient object?

Your error simply mentions that the file could not be found, DownloadFileAsync needs a file stream, and if that's not there, you get an error...

Any thoughts in implementing a log system that can be activate through a parameter that would POST the log file into your FTP for example?

You could make use of several open source projects out there, like ExceptionReporter.




回答2:


After the sysadmin played with the server config a bit this problem seemed to go away, I'm not sure exactly what was done though.



来源:https://stackoverflow.com/questions/9454984/webclient-error-getting-response-stream

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!