Date: 11/10/05 (C Sharp) Keywords: html, web I'm writing a program that basically is supposed to go to a site that has a mailing list archive on it and download each message from the archive, month by month. I've got all the parsing stuff taken care of to where it's getting the correct links and downloading the correct messages, etc. I've also got it so that it'll download about 6 months of messages. After that, I get a socket exception with the message "A system call that should never fail has failed." Does anyone have any idea what could be causing this? Unable to read data from the transport connection: A system call that should never fail has failed. at System.Net.ConnectStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.IO.StreamReader.ReadBuffer() at System.IO.StreamReader.ReadToEnd() at MListGetter.Form1.getPage(String address) <==this method should download the message at MListGetter.Form1.getMsgText(String url) at MListGetter.Form1.processMonth(String dateline, String url) at MListGetter.Form1.button1_Click(Object sender, EventArgs e) Here is the text of the method where the exception is thrown: private string getPage(string address) { System.Net.WebClient cl = new System.Net.WebClient(); System.IO.Stream s = cl.OpenRead(address); System.IO.StreamReader sr = new System.IO.StreamReader(s); string res = sr.ReadToEnd(); sr.Close(); s.Close(); cl.Dispose(); return res.Replace("\n", "\r\n"); } I would be eternally grateful to anyone who can shed some light on this. Source: http://www.livejournal.com/community/csharp/41360.html
|